Greetings,
Here are the fields I'm working with, generically:
Field01, Field02, OrderDate
The desired output of this SQL would be one record at most, as I am looking for only the Maximum Date where Field01 = X OR Field02 = X, though I still want to see the values of Field01 or Field02 if they do indeed = X
Additionally, I am only concerned with records whose OrderDate is within the last 120 days.
I will be using this SQL in the context of a recordset called from a visual basic function, i.e.:
I've had problems with getting the DateDiff() function to work in this context, which is why I wanted to bring it to attention. (Usually the "d" in DateDiff("d", ) highlights in debugger)
Anyway, hopefully that will be enough to get started. Thank you in advance for your help!
~Melagan
______
"It's never too late to become what you might have been.
Here are the fields I'm working with, generically:
Field01, Field02, OrderDate
The desired output of this SQL would be one record at most, as I am looking for only the Maximum Date where Field01 = X OR Field02 = X, though I still want to see the values of Field01 or Field02 if they do indeed = X
Additionally, I am only concerned with records whose OrderDate is within the last 120 days.
I will be using this SQL in the context of a recordset called from a visual basic function, i.e.:
Code:
dim rstX as Recordset, SQLText
SQLText = "(SQL for above criteria)"
set rstX = CurrentDB.OpenRecordset(SQLText)
I've had problems with getting the DateDiff() function to work in this context, which is why I wanted to bring it to attention. (Usually the "d" in DateDiff("d", ) highlights in debugger)
Anyway, hopefully that will be enough to get started. Thank you in advance for your help!
~Melagan
______
"It's never too late to become what you might have been.