1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

MSSQL Search Statement

Discussion in 'Software Development' started by msfdisk, Mar 15, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. msfdisk

    msfdisk Thread Starter

    Joined:
    Jan 5, 2007
    Messages:
    35
    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
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,189
    What are you using as the interface for the search? I think it is more Dependant on the application you are using than MSSQL.
     
  3. msfdisk

    msfdisk Thread Starter

    Joined:
    Jan 5, 2007
    Messages:
    35
    My pages are developed in PHP...
    Several tables are not related.



     
  4. MMJ

    MMJ Guest

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    Use the select statement.
     
  5. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,189
    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.
     
  6. MMJ

    MMJ Guest

    Joined:
    Oct 15, 2006
    Messages:
    3,625
    I don't see whats so hard about it, I've done it before.
     
  7. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,189
    Well maybe our friend could post some code and you could hook him up?
     
  8. msfdisk

    msfdisk Thread Starter

    Joined:
    Jan 5, 2007
    Messages:
    35
    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?
     
  9. Sponsor

As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/552077