I'm using an SQL Database with a Column called "Date" that has dates in a format dd/mm/yyyy
I'm trying to do a search for dates between a range and return it to a table.
I just can't get it to work.
I found this code that I have adapted to suit my names:
Code: Select all
put "SELECT * from EPAccounts WHERE CONVERT(DATETIME, Date, 103) BETWEEN '" & tStartDate & "' and '" & tEndDate & "';" into tSQL
This is borrowed from a site where it is supposed to have worked as an SQL query.
When I run it, I get the error:
"revdberr,Database Error: no such column: DATETIME"
What am I doing wrong?
Is there a better way of telling SQL that the dates in the column Date are in the dd/mm/yyyy format and search between the dates?
X