What's wrong with my query string?
Hi,
I am using a MS Access 2003 database file to connect to via my C-Sharp application.
When I try to retrieve records from the database, I keep getting a "missing operator" error message. Here is my query string.
string MySqlString = "SELECT * FROM Backups " +
"WHERE (Backups.DATE_OF_BACKUP >= " + this.startDate + ") AND "+
"(Backups.DATE_OF_BACKUP <= " + this.endDate + ")";
The startDate and endDate are DateTime variables that contain dates in the following format:
1/28/2003 12:00:00 AM
My biggest problem may be incorrect syntax when using a date value with MS Access 2003.
Here is what MySqlString string holds after creating it:
SELECT * FROM Backups WHERE (Backups.DATE_OF_BACKUP >= 1/1/2003 12:00:00 AM) AND (Backups.DATE_OF_BACKUP <= 1/28/2004 12:00:00 AM)
Any help would be apprecciated!
Thanks!