Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

MSSQL Search Statement


(!)

msfdisk's Avatar
msfdisk msfdisk is offline
Member with 35 posts.
THREAD STARTER
 
Join Date: Jan 2007
15-Mar-2007, 10:05 PM #1
MSSQL Search Statement
I'm new to MSSQL. I need to develop 2 Search Functions based on several dropdowns, fields, etc. Most "criteria" are in different tables.

What is the best way to effeciently do this?

Thanks
Rockn's Avatar
Computer Specs
Member with 21,189 posts.
 
Join Date: Jul 2001
Location: Somalia of the North, MN
Experience: Disenfranchised American
18-Mar-2007, 07:47 AM #2
What are you using as the interface for the search? I think it is more Dependant on the application you are using than MSSQL.
msfdisk's Avatar
msfdisk msfdisk is offline
Member with 35 posts.
THREAD STARTER
 
Join Date: Jan 2007
18-Mar-2007, 09:22 PM #3
My pages are developed in PHP...
Several tables are not related.



Quote:
Originally Posted by Rockn
What are you using as the interface for the search? I think it is more Dependant on the application you are using than MSSQL.
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,625 posts.
 
Join Date: Oct 2006
19-Mar-2007, 11:39 AM #4
Use the select statement.
Rockn's Avatar
Computer Specs
Member with 21,189 posts.
 
Join Date: Jul 2001
Location: Somalia of the North, MN
Experience: Disenfranchised American
19-Mar-2007, 12:46 PM #5
Quote:
Originally Posted by MMJ
Use the select statement.
Gee really! The problem is running it against several tables that have no relationship. You could set up a submit button for each text field or use something like SWITCH based on which text field is not empty on your form.
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,625 posts.
 
Join Date: Oct 2006
19-Mar-2007, 01:13 PM #6
I don't see whats so hard about it, I've done it before.
Rockn's Avatar
Computer Specs
Member with 21,189 posts.
 
Join Date: Jul 2001
Location: Somalia of the North, MN
Experience: Disenfranchised American
19-Mar-2007, 05:57 PM #7
Well maybe our friend could post some code and you could hook him up?
msfdisk's Avatar
msfdisk msfdisk is offline
Member with 35 posts.
THREAD STARTER
 
Join Date: Jan 2007
19-Mar-2007, 08:56 PM #8
I did a select...
where criteria
UNION ALL
select...
where criteria
UNION ALL

that got me alot of NULL values
since the tables are not in relation, is there a way to somehow group these unrelated tables?
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2