Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encapsulating the filters of a query

Status
Not open for further replies.

MTarkington

Programmer
Feb 14, 2001
73
US
I apologize if this has already been answered, but I did not see any questions regarding my issue.

Being a newbie to MS SQL, I am in need of finding a way to encapsualte the filters in my WHERE clause.

An Example:

WHERE (Table1.field2 < Table2.field7 or
Table3.field3 is null) and
Table1.field2 is not null

Above, I want to make sure that Table1.field2 < Table2.field7 is contined w/in the OR statement, but I want it to also agree w/ the Table1.field2 statement that I have located outside of the parenthesis.

I'm sure there is a way to use parents, brackets, etc...to make sure that the parameter searches thru the data the way I'm after, I just don't know what it is...

If you need any further details, please let me know.

TIA,
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top