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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple if statement question

Status
Not open for further replies.

SMAlvarez

Programmer
Dec 4, 2005
27
0
0
US
Ok lets say I have an area for STATE, AGE, and SALARY. And I want it to be like this:

1. state = new york
2. age = greater then 40
3. and salary greater then 20000

Do I need 3 actual if statements? or 3 ands?

thanks for the help!
 
mixture of AND and IF's, but what you want there is still not very clear.

Please post what you have tried so far, along with sample data, and sample output based on the data you supply.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
I just need help with the if statement

ie:

if state = 'NEW YORK' AND salary > 20000 AND age > 40

can you use two ands like that? or is there another way?
 
uhhh...you basically got it... I like to put ()'s on each condition, more for readability than anything else.
 
With only ANDs or only ORs, parentheses serve no purpose whatsoever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top