> 
> On Thu, Apr 14, 2005 at 07:50:43AM -0400, Jeff Urlwin wrote:
> > > > 
> > > > I would write as:
> > > > $dt = "#04-MAY-2004 17:03:34#";
> > > 
> > > Wouldn't single quotes also work?:
> > > 
> > >   $dt = "'04-MAY-2004 17:03:34'";
> > > 
> > > > Converting the month to a 3-character string version forces
> > > Access to
> > > > recognise the 1st part as the day and the last part as 
> the year. 
> > > > If
> > > > you don't do this, it's selection of day/month/year 
> > > positions appears
> > > > to be random.
> > > 
> > > Doesn't putting the year first force YYYY-MM-DD interpretation?
> > > 
> > > Tim [who doesn't know Access (and doesn't want to) but is curious]
> > 
> > Sorry for responding late.  The best way with DBI & ODBC is 
> to use the 
> > ODBC date and time formats, which are in the DBD::ODBC 
> tests.  Perhaps 
> > it should be in the documentation too ...  The short 
> version is to use ODBC escapes:
> >     {d 'YYYY-MM-DD'}
> >     {ts 'YYYY-MM-DD HH:MM:SS'}
> 
> Thanks Jeff. But do you know the answers to the two questions?

In terms of Access, I don't really know what it will and won't do in "ODBC" 
mode, rather
than "JET" mode.  Access has two (ugly) heads and DBI/DBD::ODBC only tap into 
the ODBC
side, while the Access interface side has different rules/behavior (you can 
create certain
column types in the engine that you can't in ODBC, as far as I can tell).  

In the strictest ODBC sense, no, it doesn't seem to work that way...in either 
case.  THE
thing to do is escape the dates and times as per above.  That will also ensure 
some level
of compatibility across database systems.  Typically, I find that you get 
compatibility
with the host DBMS, but Access is different.  The "jet" / front end side does 
things
differently than the ODBC "front end" -- it's just two heads accessing the same 
tail
(again, as far as I can tell).

Jeff

> 
> Tim.
> 

Reply via email to