Having trouble writing IFF statement

SDickson2

Registered User.
Local time
Today, 14:30
Joined
Nov 19, 2015
Messages
13
I have a query that sums values from tables and want to set condition something like this >=24 is 1 <24 is 0 and tried to write expression like this Severe Addiction: IFF "expr"[Assistv30]![TobaccoProducts] >=24,"1", "0"

but cant seem to figure out what to use as the underlined EXPR
 
Try

IIf([Assistv30]![TobaccoProducts] >=24,1, 0)
 
writing as suggested I get error message "Undefined function <name> in expression

SevereTobaccoAddiction: IIf([Assistv30]![TobaccoProducts] >=24,1, 0)

TobaccoProducts is actually CInt(Q1)+CInt(Q2)+CInt(Q3)+CInt(Q4)+CInt(Q5)+CInt(Q6)+CInt(Q7)

in same query, which works giving me scores ranging from 0 thru 38. but i am only concerned with scores 24 and greater to SUM
 
You can try repeating the calculation in the IIf(). Your data doesn't appear normalized.
 
No problem, post back if you get stuck.
 
i seem to be writing this wrong
TobaccoProducts Value was converted to numbers from a "how often" questionaire thus

(CInt([Q1 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q2 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q3 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q4 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q5 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q6 TobaccoproductsCigarettesChewingTobaccoCigars])+CInt([Q7 TobaccoproductsCigarettesChewingTobaccoCigars])) AS TobaccoProducts which gives me numeric value trying to insert where into this

IIf([Assistv30]![TobaccoProducts] >=24,1, 0)
I must be missing part of something
 
Wow i see my error in the writing the IIf expression works

Thank You soo much!!
 
Glad you got it sorted.
 

Users who are viewing this thread

Back
Top Bottom