orangeseatbelt
Technical User
ok, I've got a straightforward SQL statment with a where clause
The where clause is as follows:
"(r_date > #" & Startdate & "#) and " & _
"(r_date < #" & db_valid.Fields("r_date") & "#) and " & _
StartDate contains 12/09/2010
and db_valid.Fields("r_date") contains 19/09/2010
the statement works but it's showing dates that are BEFORE the startDate - it just seems to be ignoring the first date check and only using the second. If I put the date I KNOW is in startDate into the sql string it works perfectly well and I get the results I should!
I've tried declaring StartDate as a date, as a string. I've tried converting it with cDate before I use it, I've checked that it is a date with isDate.... I've replaced the # with single quotes, I've removed the #...
What the hell is the problem!? driving me to distraction
The where clause is as follows:
"(r_date > #" & Startdate & "#) and " & _
"(r_date < #" & db_valid.Fields("r_date") & "#) and " & _
StartDate contains 12/09/2010
and db_valid.Fields("r_date") contains 19/09/2010
the statement works but it's showing dates that are BEFORE the startDate - it just seems to be ignoring the first date check and only using the second. If I put the date I KNOW is in startDate into the sql string it works perfectly well and I get the results I should!
I've tried declaring StartDate as a date, as a string. I've tried converting it with cDate before I use it, I've checked that it is a date with isDate.... I've replaced the # with single quotes, I've removed the #...
What the hell is the problem!? driving me to distraction