How do I do a multiple if statement in a query?
eg iif(fieldname=1,1,);iif(samefieldname=2,2,);iif(sa mefieldname=3,3,); up to 5
How do I do a multiple if statement in a query?
eg iif(fieldname=1,1,);iif(samefieldname=2,2,);iif(sa mefieldname=3,3,); up to 5
I prefer a User Defined Function (UDF) to nested IIF's. Much easier to read, understand and most importantly maintain.
iif(fieldname=1,1,(iif(samefieldname=2,2,(iif(same fieldname=3,3,)))))
like RG I don't like nested beyond a couple levels if the logic is complicated - but will instead spread/break them apart in separate calculated fields in the query; and then tie them together with another calculated field. The advantage of this approach is one gets to visually inspect the intermediate logic results....
Great Thanks