I have a TEXT field which contains a Date in a Table in an ACCESS Database
I want to select records from the table using an SQL Statement
Code:
eg, Select * from Table where DateField between #01/01/2004# and #31/07/2004#
The problem is that the DateField is treated as a text literal rather than a date, so in reality, every date on file is selected
Is there a trick to make the SQL Statement understand that the text field is in fact a date field and therefore do a date comparison rather than a text comparison ?
eg, Is there a way I can invert the text field (withing the SQL Statement) so I am comparing with a value like 20040525
RESOLUTION
You need to add the cdate function to the string
Code:
eg, Select * from Table where cdate(DateField) between #01/01/2004# and #31/07/2004#
Thanks