[AccessD] Problem with IIF statement

Ryan W wrwehler at gmail.com
Wed Dec 4 10:01:31 CST 2019


First glance you're missing a right Paren on the first Nz([Oil,0 piece of
code and/or it appears you have it way out before your less than sign?



On Wed, Dec 4, 2019 at 9:57 AM Kaup, Chester <Chester_Kaup at kindermorgan.com>
wrote:

> I have the following IIF statement
>
> ProducerCount:
> IIf(Nz([Oil],0+Nz([Wtrp],0)+Nz([HCGas],0)+Nz([Co2P],0))>0,1,0)
>
> The value of Oil, Wtrp and CO2P are 0. The value of HCGas is 7258. The
> result of the IF statement is 0
>
> I tried adding all 4 values together and got a sum of 7258. All values are
> defined a type double in the source table.
>
> I don't understand what is happening. Maybe there is a better way to write
> the query.
>
> Thanks for your assistance.
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list