Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am trying to gather a set of reco

Status
Not open for further replies.

Jacqui1811

Programmer
Jul 8, 2002
100
SG
I am trying to gather a set of records from an access database based on a from and to date criteria.

My connection string is
DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" and mydatabase.
I know this works because I can select using other criteria fine.

My SQL reads
&quot;select * from actions where [Target Date] >= datevalue('31/12/2002') and [Target Date] <= datevalue('05/04/2003')&quot;

I get the error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error. in query expression 'select * from actions where [Target Date] >= datevalue('31/12/2002') and [Target Date] <= datevalue('5/4/2003')'.

If I paste this as a query directly into the database itself and run it, it works fine.

Can anybody help me please ?? [sad] [shadessad]

Jacqui.xx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top