J
Jim H
I'm trying to get a bunch of records based on client id and a date range. I
keep getting an error when I enclose my date string in quotes in the where
cleause.
The error is:
Microsoft JET Database Engine: Data type mismatch in criteria expression.
If I remove the quotes and use MyDateVar.ToShortDateString the select
executes but ignores the date in the resulting dataset. I get all dates.
Here is my select as it goes into the OleDbDataAdapter:
select * from TableA where ClientId = 1 and RecDate between '7/15/2003
12:00:00 AM' and '7/15/2003 11:59:59 PM'
This select gives me the above error. I get the error even if I use
ToShortDateString if the date is quoted. I never had a problem with this
using VS.NET2002 and SqlClients.
This is VS.NET2003 and an Access database.
Any help or insight would be greatly appreciated.
Thanks,
Jim
keep getting an error when I enclose my date string in quotes in the where
cleause.
The error is:
Microsoft JET Database Engine: Data type mismatch in criteria expression.
If I remove the quotes and use MyDateVar.ToShortDateString the select
executes but ignores the date in the resulting dataset. I get all dates.
Here is my select as it goes into the OleDbDataAdapter:
select * from TableA where ClientId = 1 and RecDate between '7/15/2003
12:00:00 AM' and '7/15/2003 11:59:59 PM'
This select gives me the above error. I get the error even if I use
ToShortDateString if the date is quoted. I never had a problem with this
using VS.NET2002 and SqlClients.
This is VS.NET2003 and an Access database.
Any help or insight would be greatly appreciated.
Thanks,
Jim