Link to home
Start Free TrialLog in
Avatar of davetough
davetough

asked on

create field in query w/conditional statement

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
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

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;
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davetough
davetough

ASKER

thank you - GREAT