[prev in list] [next in list] [prev in thread] [next in thread]
List: dbi-dev
Subject: RE [solution]: DBD::ODBC, Access, and WHERE Date = ?
From: Dave Paris <dparis () w3works ! com>
Date: 1998-11-26 22:26:05
[Download RAW message or body]
*** From dbi-users -- To unsubscribe, see the end of this message. ***
> Look up the Help file for the cdate() date conversion function.
> For example:
>
> $sth = $dbh->prepare(q{SELECT field1, field2, field3
> FROM table
> WHERE field0 = some_field0_value
> AND date_field1 = cdate('26-nov-1998')
> AND date_field2 = cdate('1998-nov-26')
> }) or die $dbh->errstr;
[...]
> You should always test your SQL statement first in the SQL view window
> to be sure it's syntactically correct and produces the expected results,
> before putting it into your Perl scripts, and especially before using
> any advanced facilities like bind_parameters and such.
Absolutely spectacular. Many thanks for the cdate() clue.
The entire problem stems from Access' -lack- of following ANSI SQL standards.
I was trying to come up with a platform/database neutral (or as neutral as
possible) solution when this problem with dates in Access crept into my world.
While I can drop in a hack to accomodate different databases, you can bet I'll
never approach Access for even prototyping a project in the future. :-)
Many thanks again,
dsp
------------------------------------------------------------------------------
To unsubscribe from this list, please visit http://www.fugue.com/dbi
If you are without web access, or if you are having trouble with the web page,
please send mail to dbi-request@fugue.com. Please try to use the web
page first - it will take a long time for your request to be processed by hand.
------------------------------------------------------------------------------
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic