Build this function in a module, then In your query, make a virutal field: GetInsCLValue([INVCL],[INVCL1], [INVCL2], [INVCL3], [INVCL4], [INVHI]) as InsCL
Code:
public function GetInsCLValue(pvINVCL,pvINVCL1, pvINVCL2, pvINVCL3, pvINVCL4,pvINVHI)
dim vRet
select case true
case isnull( pvINVCL) and isnull( pvINVCL1) and isnull( pvINVCL2) and isnull( pvINVCL3) and isnull( pvINVCL4)
vRet = pvINVHI
case isnull( pvINVCL1) and isnull( pvINVCL2) and isnull( pvINVCL3) and isnull( pvINVCL4)
vRet = pvINVCL
case isnull( pvINVCL2) and isnull( pvINVCL3) and isnull( pvINVCL4)
vRet = pvINVHI1
case isnull( pvINVCL3) and isnull( pvINVCL4)
vRet = pvINVHI2
case isnull( pvINVCL4)
vRet = pvINVHI3
end select
GetInsCLValue= vRet
end function