...

View Full Version : Select statment in ASP



zami
12-08-2007, 10:37 AM
i want to fetch records in ASP via select statement to show the data of having value 0 or 2, i used

SQLPOP3="select schoolid from univall where schoolname like '%"&stname&"%' and tehsilcode='"&Tehcode&"' and distcode='"&DistCode&"' and water <>1"
or
SQLPOP3="select schoolid from univall where schoolname like '%"&stname&"%' and tehsilcode='"&Tehcode&"' and distcode='"&DistCode&"' and water =0 and water = 2"
but its not working, i want to get records have water value 0 or 2
someone can help me
thanks

Whatever Jr.
12-08-2007, 10:58 AM
Try
select * from univall where (univall =0 or univall =2)

HTH, Tom

zami
12-10-2007, 05:04 AM
I used this again but still not working
SQLPOPdistrict="select schoolid from univall where tehsilcode='"&Tehcode&"' and distcode='"&DistCode&"' and (electricity=2 or electricity=0)"

zami
12-10-2007, 05:24 AM
i have done now thanks for you

zami
12-10-2007, 06:25 AM
now i need to handle null values in data field how to use select statment
SQLPOPdistrict="select schoolid from univall where tehsilcode='"&Tehcode&"' and distcode='"&DistCode&"' and (electricity=2 or electricity=0 and electricity =null)"

Roelf
12-10-2007, 07:27 AM
SQLPOPdistrict="select schoolid from univall where tehsilcode='"&Tehcode&"' and distcode='"&DistCode&"' and electricity in (2, 0, null)"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum