If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > can someone check this code for a nOOb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-04-04, 16:36
leeroy leeroy is offline
Registered User
 
Join Date: Jun 2002
Posts: 173
can someone check this code for a nOOb

I've managed to get the following code to do 99% of what I want it to:

SELECT tbl3.col1, tbl3.col11, tbl3.col2, tbl3.col3, tbl3.col4, tbl3.col5, tbl3.col6, tbl3.col7, tbl3.col8, tbl3.col13
FROM tbl3
WHERE ((tbl3.col13 = 1) AND ((tbl3.col11 = colcheck) AND (tbl3.col2 LIKE '%colname%' AND tbl3.col6 LIKE '%colcity%' AND tbl3.col7 LIKE '%colstate%' AND tbl3.col4 LIKE '%coladdress%' AND tbl3.col8 LIKE '%colzip%')))
ORDER BY tbl3.col2 ASC

It for an advanced search form. col13 is set manually in the code, col11 is a radio button, and the rest of the fields are optional. It's for finding contacts in a table. I have colname which is the company name, but also a want to check it against col3 (not only col2). Same with coladdress, I'd like to check it against col5 (not only col4). Does anyone know how to accomplish this?
Reply With Quote
  #2 (permalink)  
Old 05-17-04, 10:27
wharish wharish is offline
Registered User
 
Join Date: May 2004
Posts: 2
can you use better column names and resend

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On