Between Statement not working using dates

gti_jobert

Registered User.
Local time
Today, 08:25
Joined
Apr 4, 2006
Messages
11
Hi,

I am using an ADO connection to an access Db but am having from executing a query on the table.

In my table I have a Field named [Date] with Data Type as Date/Time (Short Date dd/mm/yyyy). When I perform a Query on the Db like;

Code:
SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] LIKE '28/03/2006'

The above works fine and produces results, but if I do the following - then it come up with error - data type mismatch;

Code:
SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] = '28/03/2006'

Any Ideas Why? TIA
 
SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] = #28/03/2006#

???
 
Thank you so much, it now works!
 
Cool. (I'm still at a bit of a loss as to where the 'between' problem was :))
 

Users who are viewing this thread

Back
Top Bottom