Hi guys, Could someone please tell me what I'm doing wrong here. When I run the following code it works fine: use Win32::ODBC; $db3 = new Win32::ODBC($DSN); $SqlStatement3 = "SELECT * FROM ioc_signal where Type = 5"; if ($db3->Sql($SqlStatement3)){ print "SQL failed.\n"; print "Error: " . $db3->Error() . "\n"; $db3->Close(); exit; } #$db3->Sql($SqlStatement3); while($db3->FetchRow()){ #do stuff }
but when I add-in another where clause I get an error: use Win32::ODBC; $db3 = new Win32::ODBC($DSN); $SqlStatement3 = "SELECT * FROM ioc_signal where Type = 5 and where Panel Letter = $facia_panel_letter and where Panel Item = $facia_panel_item and where Panel Sub-Item = $Data{\"Window\"}"; if ($db3->Sql($SqlStatement3)){ print "SQL failed.\n"; print "Error: " . $db3->Error() . "\n"; $db3->Close(); exit; } #$db3->Sql($SqlStatement3); while($db3->FetchRow()){ #do stuff } Error message: SQL failed. Error: [-3100] [4] [0] "[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Type = 5 and Panel Letter = F and Panel Item = 13 and Panel Sub-Item = 4.0'." I'm running Perl 5.6.1 Build 635 on Windows XP Pro accessing a MSaccess 97 database. Thanks in advance for any assistance. Ewen _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs