ThatNewGuy
Technical User
Hello,
First of all I know there are a million BETTER ways to do this, but I've managed to get the first half of this to work in my database so I'm running with it. I'm trying to nest several Iif functions together in one query field but I'm having some problems. The first portion of the Iif function works exactly as I need it to, as it rounds any number below 1 such as .67 up to 1 and it rounds any larger number to its interger such as 3.6 to 3. What I need to accomplish now is if there are 4 new part samples ordered that the query won't run through the initial function but by pass it to apply the additional nested Iif function to simply state that there are 4.
IIF ( [Packages] <1 , Int([Packages] +1) , Fix([Packages])
the above portion works as needed on its own...
When I add the nested Iif it looks like this:
IIF ( [Packages] <1 , Int([Packages] +1) , Fix([Packages]) ,
IIF ( [Shipped] =4 , [Shipped]*1 , [Shipped]*1 ))
Access returns an error that reads "expression you entered has a function containing the wrong # of arguments"
Any help is appreciated. Thanks.
First of all I know there are a million BETTER ways to do this, but I've managed to get the first half of this to work in my database so I'm running with it. I'm trying to nest several Iif functions together in one query field but I'm having some problems. The first portion of the Iif function works exactly as I need it to, as it rounds any number below 1 such as .67 up to 1 and it rounds any larger number to its interger such as 3.6 to 3. What I need to accomplish now is if there are 4 new part samples ordered that the query won't run through the initial function but by pass it to apply the additional nested Iif function to simply state that there are 4.
IIF ( [Packages] <1 , Int([Packages] +1) , Fix([Packages])
the above portion works as needed on its own...
When I add the nested Iif it looks like this:
IIF ( [Packages] <1 , Int([Packages] +1) , Fix([Packages]) ,
IIF ( [Shipped] =4 , [Shipped]*1 , [Shipped]*1 ))
Access returns an error that reads "expression you entered has a function containing the wrong # of arguments"
Any help is appreciated. Thanks.