Win32::ODBC SQL and using date 
Author Message
 Win32::ODBC SQL and using date

I am working on this script and I can not seem to get the date in the select
statement.

$pclose = new Win32::ODBC("pclose") or die "Can not connect to Oasis DB\n";
 $stm = "SELECT ELSDATE FROM h_shift " .
     #'WHERE shift_seq < 9999 and ' .
     'where ELSDATE BETWEEN {d ' . $START_DATE . '}  ' .
     'AND {d ' . $DATE . '}' ;

 if ($pclose->Sql($stm)) {
    $err = $pclose->Error;
    warn "\nSQL Error:\n";
    warn "\tSQL COMMAND: $stm\n";
    die  "\tSQL   ERROR: $err\n";
 }

The error message I get:
SQL Error:
SQL COMMAND: SELECT ELSDATE FROM h_shift where ELSDATE BETWEEN {d
1998-06-01} AN
D {d 1998-06-02}
SQL   ERROR: [-3100] [1] [0] "[Microsoft][ODBC dBase Driver] Syntax error
(missi
ng operator) in query expression 'ELSDATE BETWEEN d 1998-06-01} AND d
1998-06-02

Quote:
}'."

TIA

Christian Brink



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Perl5 Win32::ODBC SQL Statement Involing dates

2. LONG: Req: Help in retrieving values from SQL Server stored procedure using Win32::ODBC

3. looping through an sql query using win32::odbc

4. SQL error 170 using Win32::ODBC

5. looping through an sql query using win32::odbc

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

7. ODBC Sql Date field

8. Q: Can't connect to SQL data source name via Win32::ODBC API

9. Win32:ODBC and Microsoft's SQL Server 6.5

10. SQL Pass-thru query with Win32::ODBC?

11. Win32::ODBC and Sql

12. Win32::ODBC and transactions with SQL Server

 

 
Powered by phpBB® Forum Software