i wud like to select records which userStatus' values is sth.
ive gt a tbl with a userStatus column, dis column is stored with statusID and the values in dis column, userStatus, are either numbers or nothing inside.
now i wud like to retrieve the userStatus which values are sth inside and hw shd i retrieve? cos in d web form ive gt a listbox showing all the status. now im including an ALL status to select all the status frm the db.
<%sql = "Select * from status ORDER BY statusType ASC"
set rsS = Conn.Execute(sql)
do while not rsS.eof
response.Write("<option value='"&rsS("statusID")&"'")
if request.QueryString("statusType") <> "" then
state = split(request.QueryString("statusType"),"|")
for each rec in state
if rsS("statusID") = Cint("0" & rec) then response.Write(" selected")
next
end if
response.Write(">"&rsS("statusType")&"</option>")
rsS.moveNext
loop
%>
</select>
if request.QueryString("statusType") <> "" then
sqlC = "select * from t_user_account where (userStatus='"&replace(request.QueryString("statusType"),"|","' or userStatus = '")&"')"
set rsC= conn.execute(sqlC)
end if
btw do anyone noe hw to explain such select sql statemt:
select * from user_acc where userStatus like '%_%'
to my knowledge, i understand that userStatus like '%%' is to retrieve evry single rec frm d tbl.
and _ is to select a single char but it shd b coded with like this: '_' then the userStatus = 5, 6 will be retrieved.
so hw abt userStatus like '%_%'?
thanks in advance!!