We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

create field in query w/conditional statement

davetough
davetough asked
on
Medium Priority
276 Views
Last Modified: 2012-05-11
hello,
i have attached example db-
is there a way to add a field to qry1 -[newfield]
that has conditional statement that says:
if field 111 or 222 is checked then the newfield has 5 entered
and if field 333 or 444 is checked the newfield has 6 entered
thank you
database2.mdb
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
try this query

SELECT tbl1.ID, tbl1.[item number], tbl1.[111], tbl1.[222], tbl1.[333], tbl1.[444], tbl1.[model number], IIf([111]=-1 Or [222]=-1,5,IIf([333]=-1 Or [444]=-1,6,0)) AS Expr1
FROM tbl1;
CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
thank you - GREAT
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.