Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-25-2002, 09:18 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Can we use 3conditions in WHERE Clause

[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
Reply With Quote
  #2  
Old 06-25-2002, 09:32 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Can we use 3conditions in WHERE Clause

[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
Reply With Quote
  #3  
Old 06-25-2002, 07:43 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Can we use 3conditions in WHERE Clause

[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! :-)
Reply With Quote
  #4  
Old 07-05-2002, 07:05 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Can we use 3conditions in WHERE Clause

[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
Reply With Quote
  #5  
Old 07-05-2002, 10:16 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Can we use 3conditions in WHERE Clause

[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.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:46 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.