Using AND in Select Script
trying to select some field from a Sybase Database, see below for my piece of code, the select statement is not returning any record if AND is use. How can I resolve this, any help. See code below;
SELECT * from nitel_bill_payment where sequence_number = " &pcode& " AND bill_number = "&bill&"
where &pcode& and &bill& are textboxes name
However, what you have seems to be a proper ANSI SQL type statment, although I tend to shy away from all those extra spaces
WHERE sequence_number="&pcode&" AND bill_number="&bill&"
Double check your column names too.
I'll move this to the SQL forum.
No idea about the SQL used for Sybase, but if the values you compare against are numbers, thus containing numerical values, why do you have to put &pcode& and &bill& in quotes? Am I correct in assuming that this creates string values?
I know for sure that MySQL would let you go away unnoticed if you compare number values against string values... but that's not true for all SQL databases.
|All times are GMT +1. The time now is 08:34 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.