Hi experts..
I cannot get my iif statement to work in access query; its driving me mad, just cant seem to grasp the nulls I think.
I need to calculated a waiting time with adjustments, I have a field called RTT which is the current wait in days without adjustments.
I have a field called total suspension which is the number of days to deduct from RTT if populated, and if there is a DNA Date I need to work out the RTT from DNA date to todays date to give the new RTT days waiting....But they could both apply, or just one apply or non apply?
this is what i had but doesnt work for all IIFs: ive switched them around and tried isnull etc
RTTdADJ:
IIf([DNADate] Is Not Null,DateDiff("d",[DNADate],Date()),IIf([DNADate] And [Total Suspension] Is Null,[RTT],IIf([DNADate] And [Total Suspension] Is Not Null,(DateDiff("d",[DNADate],Date()))-[Total Suspension],[RTT]-[Total Suspension])))
thank you for any advice on this one
i will keep trying in the mean time
I cannot get my iif statement to work in access query; its driving me mad, just cant seem to grasp the nulls I think.
I need to calculated a waiting time with adjustments, I have a field called RTT which is the current wait in days without adjustments.
I have a field called total suspension which is the number of days to deduct from RTT if populated, and if there is a DNA Date I need to work out the RTT from DNA date to todays date to give the new RTT days waiting....But they could both apply, or just one apply or non apply?
this is what i had but doesnt work for all IIFs: ive switched them around and tried isnull etc
RTTdADJ:
IIf([DNADate] Is Not Null,DateDiff("d",[DNADate],Date()),IIf([DNADate] And [Total Suspension] Is Null,[RTT],IIf([DNADate] And [Total Suspension] Is Not Null,(DateDiff("d",[DNADate],Date()))-[Total Suspension],[RTT]-[Total Suspension])))
thank you for any advice on this one