[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

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
0
davetough
Asked:
davetough
  • 2
1 Solution
 
Rey Obrero (Capricorn1)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;
0
 
Rey Obrero (Capricorn1)Commented:
see query from sample file
database2rev.mdb
0
 
davetoughAuthor Commented:
thank you - GREAT
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now