Forums
This topic is locked
filter recordset
Posted 11 Jun 2001 00:08:33
1
has voted
11 Jun 2001 00:08:33 gianluca jean posted:
What is the sql stantement to filter more fieldsthe stantement for me don't work well because
Suppose we have a table (Tabella) and 2 fields (ID, Descriptions)
Tabella:
ID Descriptions
1 asd
2 gffaf
3 ffsag
4 fgfgs
5 fwsfs
search is: 2
the query is
"SELECT *
FROM Tabella
WHERE ID OR Descriptions = ' " + Request.Form("search" + " ' "
results:
1 asd
2 gffaf
3 ffsag
4 fgfgs
5 fwsfs
right results [for me]
2 gffaf
Thanks to all
Replies
Replied 11 Jun 2001 17:03:13
11 Jun 2001 17:03:13 Jay Blanchard replied:
You don't say which database or SQL system you are using, but in MS SQL 7.0 I get a syntax error (I removed the unnecessary quotes from the statement) when using the SQL statement as you have written it. Try this...
SELECT *
FROM Tabella
WHERE ID = ' " + Request.Form("search" + " '
OR Descriptions = ' " + Request.Form("search" + " '
SELECT *
FROM Tabella
WHERE ID = ' " + Request.Form("search" + " '
OR Descriptions = ' " + Request.Form("search" + " '
Replied 15 Jun 2001 07:20:01
15 Jun 2001 07:20:01 j doyle replied:
sorry...mistake