in reply to Re: DBD::ODBC, Access, date comparisons
in thread DBD::ODBC, Access, date comparisons

I'm using placeholders because it's not always going to be 'today' that I want to match. The eventual statement will be a BETWEEN clause.

Maybe I need to just make my dates go to a minute before and a minute after midnight, on the appropriate dates.

The thing that kills me is if I do this

WorkOrd.ClearDate >= #3/19/2003#
it works correctly. Trying to get the hash-marks into the placeholder is what causes the ODBC driver to bomb though; I don't know what's happening in there.

Replies are listed 'Best First'.
Re: Re: Re: DBD::ODBC, Access, date comparisons
by dga (Hermit) on Mar 20, 2003 at 16:44 UTC

    Have you tried WHERE WorkOrd.ClearDate >= #?# as your clause fragment?

      Yup - that was one of the first things I tried. Bomb:
      DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver +] Syntax error in date in query expression 'WorkOrd.StatCode5 = 'C' a +nd ( WorkOrd.ClearDate is NULL or ( WorkOrd.ClearDate BETWEEN #Pa_RaM000# and #Pa_RaM001# ) )'. (SQL-37000)(DBD: st_execute/SQLExecute err=-1) at O:\Scripts\P +erl\ServiceReports\test-av-citigroup.pl line 54. Uncaught exception from user code: Could not execute statement. Error:[Microsoft][ODBC Microsoft Acce +ss Driver] Syntax error in date in query expression 'WorkOrd.StatCode +5 = 'C' and ( WorkOrd.ClearDate is NULL or ( WorkOrd.ClearDate BETWEEN #Pa_RaM000# and #Pa_RaM001# ) )'. (SQL-37000)(DBD: st_execute/SQLExecute err=-1) Report run on 2003-03-19 Report runs from 2003-03-19 to 2003-03-2 +0.