Is there a limit to nested IIf statements?

J

James

I've run into a problem when I try to nest 4 IIf
statements in one colum in a query. What I input is:

HepB: IIf(Nz([Hep B #1Rec],0)* Nz([Hep B #2Rec])* Nz
([Hep B #3Rec],0)<>0, Null, IIf([Hep B #3Rec] is not null,
null, IIf([Hep B #2Rec] is not null, DateAdd("m",6,[Hep B
#2Rec]), IIf([Hep B #3Rec] is null, "Need inital Hep B
shot", DateAdd("m",1,[Hep B #1Rec])))))

I build the IIf statements one at a time and then run them
to ensure they work. It is only when I add the fourth IIf
statement that I get an "#error" in my results. I had
planed to make this a nested IIf statement with two other
statements of the same length. Am I doing something wrong
or do I need to rethink stringing all these together?
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top