> 
> 
> On Thu, Apr 14, 2005 at 09:19:00AM +1000, Daniel Kasak wrote:
> > Robb wrote:
> > 
> > > Hi,
> > >
> > > Does anyone have any idea what is up with Microsoft 
> Access and its 
> > > ridiculous Date/Time formatting options?
> > 
> > :)
> > 
> > In VB, I use the format:
> > 
> > #dd-mmm-yyyy HH:mm:ss#
> > 
> > Your example:
> > $dt = "#4/5/2004 5:3:45 PM#";
> > 
> > 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'}
Or
        {ts 'YYYY-MM-DD HH:MM:SS'}

This works on most ODBC drivers correctly, even when binding parameters, 
although I recall
that I had issues with Oracle drivers at one point.

Note also that since you are using DBI and ODBC, you are in effect bypassing 
some of the
Access front end specifics.

Regards,

Jeff

> 

Reply via email to