If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IFF Statement, 3 options
How come this doesn't work?
=IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null, then nothing appears If the field is less than 50, but more than 0 then Benefit Recognized If the field is 0, then nothing goes in the box Thanks in advance! |
#2
|
|||
|
|||
IFF Statement, 3 options
at a quick glance this looks to me like it resolves to:
IIf([txt_cumulamt7] BETWEEN 1 AND 49,"Benefit Recognized,"") "chickalina" wrote in message ... How come this doesn't work? =IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null, then nothing appears If the field is less than 50, but more than 0 then Benefit Recognized If the field is 0, then nothing goes in the box Thanks in advance! |
#3
|
|||
|
|||
IFF Statement, 3 options
Chickalina,
You have a few syntax errors in the expression. The parentheses and commas are wrong, for example the first IIf() function has 4 comma-separated arguments. As far as I know, the construct 050 doesn't make sense. If you want "nothing", then you should use Null, not "" which is a zero-length string, not nothing. So, to read from your description of what you want, try it like this: =IIf([txt_cumulamt7]0 And [txt_cumulamt7]50,"Benefit Recognized",Null) Another way, if the txt_cumulamt7 contains integer values: =IIf([txt_cumulamt7] Between 1 And 49,"Benefit Recognized",Null) -- Steve Schapel, Microsoft Access MVP chickalina wrote: How come this doesn't work? =IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null, then nothing appears If the field is less than 50, but more than 0 then Benefit Recognized If the field is 0, then nothing goes in the box Thanks in advance! |
#4
|
|||
|
|||
IFF Statement, 3 options
On Wed, 20 Dec 2006 11:38:01 -0800, chickalina wrote:
How come this doesn't work? =IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null, then nothing appears If the field is less than 50, but more than 0 then Benefit Recognized If the field is 0, then nothing goes in the box Thanks in advance! You need to repeat the criteria field name each time. You need to use the And or Or operator when applicable. =IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7] 0 and [txt_cumulant] 50,"Benefit Recognized","It's equal to or greater than 50 or less than 0")) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
IFF Statement, 3 options
Actually, upon further discussion it's more like this:
=IIf(IsNull([txt_cumulamt7]),"Continue Assessment",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null or 50, then Continue Assessment If the field is = or more than 50 ,then Benefit Recognized If the field is 0, then nothing goes in the box Blimey, if they could just confirm what they want ahead of time. sheesh! "David F Cox" wrote: at a quick glance this looks to me like it resolves to: IIf([txt_cumulamt7] BETWEEN 1 AND 49,"Benefit Recognized,"") "chickalina" wrote in message ... How come this doesn't work? =IIf(IsNull([txt_cumulamt7]),"",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null, then nothing appears If the field is less than 50, but more than 0 then Benefit Recognized If the field is 0, then nothing goes in the box Thanks in advance! |
#6
|
|||
|
|||
IFF Statement, 3 options
Chickalina,
Blimey, what you have in the description and what you have in the quasi-expression are not at all similar. If you go by the description, I would try it like this... =IIf([txt_cumulamt7]=0,Null,IIf([txt_cumulamt7]50,"Benefit Recognized","Continue Assessment")) -- Steve Schapel, Microsoft Access MVP chickalina wrote: Actually, upon further discussion it's more like this: =IIf(IsNull([txt_cumulamt7]),"Continue Assessment",IIf([txt_cumulamt7]050,"","Benefit Recognized"),IIf([txt_cumulamt7]1,"","")) If the field is Null or 50, then Continue Assessment If the field is = or more than 50 ,then Benefit Recognized If the field is 0, then nothing goes in the box Blimey, if they could just confirm what they want ahead of time. sheesh! |
Thread Tools | |
Display Modes | |
|
|