They correct syntax for ODBC is: {ts 'YYYY-MM-DD HH:MM:SS'} Jeff
> -----Original Message----- > From: Mark Riehl [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 30, 2002 9:36 PM > To: [EMAIL PROTECTED] > Subject: DBI, Access, and DATETIME > > > All - I'm trying to use DBI to read a MS Access db. One of the columns in > the DB is a Date/Time type. I'm trying to query on a range of times. > > The following works in MySQL off the command line where S_TIME is > a DATETIME > column, so I thought the MS Access call would be the same: > > select * from sa where (S_TIME > (timestamp'2001-12-04 13:00:00')) > > Trying to talk to Access, I used the following: > > $sth_select = $dbh_MSAccess->prepare("SELECT * FROM $table where (S_TIME > > (timestamp('2001-12-04 13:00:00') ))"); > > However, I get the following error (it doesn't know what the timestamp > function is): > > DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver] > Undefine > d function 'timestamp' in expression. (SQL-37000)(DBD: > st_execute/SQLExecute > err > =-1) at D:\Agile\Projects\FBCB2\Apr_02\Data\accToMySql_vload2.pl line 171. > SELECT execute ERROR for sa table: DBI::db=HASH(0x236cc78)->errstr > > Is this a quirk with Access - seemed to work ok with MySQL. > > Any suggestions/workarounds? > > Thanks, > Mark > > - > Mark Riehl > Agile Communications, Inc. > Email: [EMAIL PROTECTED] > Office: (732) 528-9305 > Fax: (732) 528-9308 > Cell: (732) 996-7630 > >