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

Complicated (?) IIF in query 1

Status
Not open for further replies.

cuok

Programmer
Dec 24, 2001
201
Hi all!

i would appricate for any help!

I have 4 fields in table:

F1, F2 F3 and TotalF

each of them can valued by: "S" or "T"
if 2 or 3 of them got "S" then TotalF=2 otherwise TotalF=1.
how can i do it?

thanks in advance
CUOK
 
Are you attempting to store a value that can be calculated? If so, do you have a good reason for this?
I suppose you could create an update query that
SET TotalF = IIf(Abs((F1="S"+F2="S"+F3="S"))>2,2,1)

Duane
MS Access MVP
 
Many thanks dhookom for your help,
i used it as a basis and it works fine.
have a star my dear!
CUOK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top