Click to See Complete Forum and Search --> : Can we use 3conditions in WHERE Clause
anonymous
06-25-2002, 09:18 AM
[Originally posted by Ram]
Hi,
ÿ Can we use three conditions in single WHERE clause
like eg:-
i want to retrieve price value on three condition
1.it should match the service code
2.it should match the destination code
3.it should match the wait
i tried this way but did'nt work out
set rs = db.recordset("select service_price from service_pricing where service_code='xyz' and destination_code='xxx' and weight>20")
but this code gave an error.
can anyone help me out to solve this problem
anonymous
06-25-2002, 09:32 AM
[Originally posted by gonzalo]
the problem could be the "recordset" command
you should use the order "recordsource"
recordset give you access to the fields, recordsource execute sql commands
see ya
gonzalo
anonymous
06-25-2002, 07:43 PM
[Originally posted by Ed Ardzinski]
I think it's the weight>20"...
In general you put quotes around strings in SQL, and numbers are left without quotes...if you really meant
weight>'20' then try weight>20 (no quotes)
Funny thing about the quotes...Jet SQL and T-SQL (Microsoft dialects) use double quotes, but when sending a SQL Statement to a a Jet or SQL Server database via ODBC you can use (in fact may need to use) single quotes.ÿ I do a lot with Sybase SQL, and the single quote is used...
Come to think of it, maybe T-SQL uses the single quotes.ÿ Been a while; but I'm soon going to be migrating 13 GB of data from Btrieve to SQL Server, so I'll be doing a little more T-SQL soon! :-)
anonymous
07-05-2002, 07:05 AM
[Originally posted by sumit]
yes u can use as many conditions in where clause..u just check your query and table in the data base whether it containd the appropriate..data or not
anonymous
07-05-2002, 10:16 PM
[Originally posted by Ron Weller]
ÿ I do this all of the time. Double check your
field names. Maybe you typed a field name
incorrectly or missed one of the quote marks.
ÿ Double check data types also. Weight could
be a text item and therefore need quotes.
devx.com
Copyright WebMediaBrands Inc. All Rights Reserved