Hello ALL,
I would like to write a query that will return records within a given date range (simple enough) BUT the date field queried varies!!
My Table has oDate, tCompleted, tDelivered, aCompleted and aDelivered as Date fields
To return records where oDate is btn two dates i have the following sql:
SELECT * FROM Orders
WHERE oDate >=[DateFrom] AND oDate <=[DateTo]
ORDER BY OrderNo
If i am interested in the other date fields i have to write EXACTLY the same sql only replacing 'oDate' with the other date fields.
Problem: Is it possible to pass the date fields (oDate, tCompleted, tDelivered, aCompleted) as parameters and hence use only one sql?? if so, how??
TIA
cpmasesa
I would like to write a query that will return records within a given date range (simple enough) BUT the date field queried varies!!
My Table has oDate, tCompleted, tDelivered, aCompleted and aDelivered as Date fields
To return records where oDate is btn two dates i have the following sql:
SELECT * FROM Orders
WHERE oDate >=[DateFrom] AND oDate <=[DateTo]
ORDER BY OrderNo
If i am interested in the other date fields i have to write EXACTLY the same sql only replacing 'oDate' with the other date fields.
Problem: Is it possible to pass the date fields (oDate, tCompleted, tDelivered, aCompleted) as parameters and hence use only one sql?? if so, how??
TIA
cpmasesa