The Timestamp Field I have is formatted like this: 11/4/2014 5:56:46 AM. The field name is [Timestamp] it is in a table named INPUT_RedSheets_Plates. I have a query right now that pulls in certain fields from this table based on criteria of the [Type] field Like This:
Code:
SELECT INPUT_RedSheets_Plates.[Type], INPUT_RedSheets_Plates.[BatchDate], INPUT_RedSheets_Plates.[BatchNumber], INPUT_RedSheets_Plates.[SampleNumber], INPUT_RedSheets_Plates.[Compound], INPUT_RedSheets_Plates.[DateRequested], INPUT_RedSheets_Plates.[RequestedBy], INPUT_RedSheets_Plates.[AcknowledgedBy], INPUT_RedSheets_Plates.[Timestamp], INPUT_RedSheets_Plates.[Notes]
FROM INPUT_RedSheets_Plates
WHERE (((INPUT_RedSheets_Plates.[Type])="Urine" Or (INPUT_RedSheets_Plates.[Type])="OF" Or (INPUT_RedSheets_Plates.[Type])="RFPanels" Or (INPUT_RedSheets_Plates.[Type])="Barbs" Or (INPUT_RedSheets_Plates.[Type])="BathSalt" Or (INPUT_RedSheets_Plates.[Type])="UCEX"));
I want to add an additional parameter. That the Timestamp field must be Date()-1. What Am I doing wrong? I tried to add it like this (NEW ADDITION IN RED):
Code:
SELECT INPUT_RedSheets_Plates.[Type], INPUT_RedSheets_Plates.[BatchDate], INPUT_RedSheets_Plates.[BatchNumber], INPUT_RedSheets_Plates.[SampleNumber], INPUT_RedSheets_Plates.[Compound], INPUT_RedSheets_Plates.[DateRequested], INPUT_RedSheets_Plates.[RequestedBy], INPUT_RedSheets_Plates.[AcknowledgedBy], INPUT_RedSheets_Plates.[Timestamp], INPUT_RedSheets_Plates.[Notes]
FROM INPUT_RedSheets_Plates
WHERE (((INPUT_RedSheets_Plates.[Type])="Urine" Or (INPUT_RedSheets_Plates.[Type])="OF" Or (INPUT_RedSheets_Plates.[Type])="RFPanels" Or (INPUT_RedSheets_Plates.[Type])="Barbs" Or (INPUT_RedSheets_Plates.[Type])="BathSalt" Or (INPUT_RedSheets_Plates.[Type])="UCEX") AND (INPUT_RedSheets_Plates.[Timestamp])= TO_DATE(Date()-1,'MM/DD/YYYY'));
I get the error that TO_DATE Is not a function. What do I need to use in place of this?
Any help would be much appreciated! Thanks for taking a look!