ODBC Sql Date field 
Author Message
 ODBC Sql Date field

I've been using ODBC and Perl ODBC.pm to access an MS Access database.  I
can easily store info in a date field (ie. "insert into table (date) values
('1997-08-25')".

However, I can't figure out how to do an SQL query using a date field.
I've tried everything I can think of (ie. "select * from table where
date='1997-05-31'") with no success.

Thanks in advance!




Fri, 19 Nov 1999 03:00:00 GMT  
 ODBC Sql Date field

Try:
"select * from table where date={d '1997-05-31'}"
This is the ODBC specific date format. Since different DBM's implement date
stamps in different ways, the ODBC Driver will convert the ODBC specific
format to it's own format. Hence this format will work for any ODBC Driver.
dave



Quote:
> I've been using ODBC and Perl ODBC.pm to access an MS Access database.  I
> can easily store info in a date field (ie. "insert into table (date)
values
> ('1997-08-25')".

> However, I can't figure out how to do an SQL query using a date field.
> I've tried everything I can think of (ie. "select * from table where
> date='1997-05-31'") with no success.

> Thanks in advance!





Thu, 02 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Win32::ODBC and Access Date & Boolean Fields

2. DBD::ODBC and date/time field overflow

3. DBD::ODBC and date/time fields

4. Perl5 Win32::ODBC SQL Statement Involing dates

5. Win32::ODBC SQL and using date

6. Win32::ODBC, Perl SQL vs. standard SQL

7. DBD::ODBC::db prepare failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tblClient'. (SQL-S0002)

8. MS SQL Server truncating text fields at 8000 characters during update

9. Inserting a large file into a MS-SQL BLOB field

10. Perl, ODBC and AutoIncrement field error.

11. Win32::ODBC - same field name in different tables causes trouble

12. Win32::ODBC - field names

 

 
Powered by phpBB® Forum Software