[AccessD] Problem with IIF statement

Gustav Brock gustav at cactus.dk
Wed Dec 4 10:00:40 CST 2019


Hi Chester

Try with this correction:

ProducerCount: IIf(Nz([Oil],0)+Nz([Wtrp],0)+Nz([HCGas],0)+Nz([Co2P],0)>0,1,0)

/gustav

-----Oprindelig meddelelse-----
Fra: AccessD <accessd-bounces at databaseadvisors.com> På vegne af Kaup, Chester
Sendt: 4. december 2019 16:57
Til: 'Access Developers discussion and problem solving' <accessd at databaseadvisors.com>
Emne: [AccessD] Problem with IIF statement

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. 



More information about the AccessD mailing list