Hi
I'm trying to build up a select statement in asp using the IN operator. I've got
SchText = request.form("cat")
if len(SchText)=0 then
SchText = "'" & SchText & "' "
Flag = Flag + 1
end if
and then the select statement (shown further below) which doesn't work because it may say
Select * From members WHERE BusinessName like '%%%%%%' AND Keywords1 like '%%%%%%' AND Cat IN ('Other , Accountants') AND DateEst >= '1899' AND DateEst <= '2005'
when it should be IN ('Other' , 'Accountants')
any ideas ?
also
if len(SchText)=0 then
I need to use a wildcard to say any category
thanks
ian
select statement
----------------
sqlstmt="Select * From members WHERE BusinessName like '%%" & SchTitle & "%%' "
sqlstmt=sqlstmt & " AND Keywords1 like '%%" & SchKeywords & "%%' "
sqlstmt=sqlstmt & " AND Cat IN ('" & trim(schText) & "')"
sqlstmt=sqlstmt & " AND DateEst >= '" & SchDateStart & "' "
sqlstmt=sqlstmt & " AND DateEst <= '" & SchDateEnd & "'"
I'm trying to build up a select statement in asp using the IN operator. I've got
SchText = request.form("cat")
if len(SchText)=0 then
SchText = "'" & SchText & "' "
Flag = Flag + 1
end if
and then the select statement (shown further below) which doesn't work because it may say
Select * From members WHERE BusinessName like '%%%%%%' AND Keywords1 like '%%%%%%' AND Cat IN ('Other , Accountants') AND DateEst >= '1899' AND DateEst <= '2005'
when it should be IN ('Other' , 'Accountants')
any ideas ?
also
if len(SchText)=0 then
I need to use a wildcard to say any category
thanks
ian
select statement
----------------
sqlstmt="Select * From members WHERE BusinessName like '%%" & SchTitle & "%%' "
sqlstmt=sqlstmt & " AND Keywords1 like '%%" & SchKeywords & "%%' "
sqlstmt=sqlstmt & " AND Cat IN ('" & trim(schText) & "')"
sqlstmt=sqlstmt & " AND DateEst >= '" & SchDateStart & "' "
sqlstmt=sqlstmt & " AND DateEst <= '" & SchDateEnd & "'"