THanks for your quick response. The query designer has got it like the following: SELECT ... , IIf([Device Definition].[DeviceType]="RTU",(-Int([IO with fuses]/(-16))),(-Int([IO with fuses]/(-32)))) AS CardsWithFuses GROUP BY... , IIf([Device Definition].[DeviceType]="RTU",(-Int([IO with...