Link to home
Start Free TrialLog in
Avatar of sltan32
sltan32

asked on

How to work with dates using ACCESS 2007 SQL Query

I wrote a SQL script to limit the data extracted from database as shown below but I'm unable run the query with the following error message as per attachment.

select * from IFSAPP.C_SHIPMENT_ORDER_DETAILS A WHERE A.ACTUAL_SHIP_DATE > #01/01/2015#

Any advice? I've also tried format and Cdate but none is able to work.
Error-messag--SQL-Date.JPG
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

Are you running this via a pass through query, - or perhaps ADODB and executing on SQL Server.

The syntax you use is fine in Access, if it is a pass though query, then the syntax must be that used by SQL Server.

It would be:
select * from IFSAPP.C_SHIPMENT_ORDER_DETAILS A WHERE A.ACTUAL_SHIP_DATE > '01/01/2015';

Kelvin
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial