Problem with IF() statement in expression builder

D

Don

I've tried to make an IF() statement in Access' Expression Builder work like
Excel, to no avail. The built-in help in Access didn't pull up any examples,
either. The expression looks like this:

SUB LENGTH: IF(IsNull([MASTER LIST]![CANCELLATION DATE]),Date()-[PURCHASE
DATE],[CANCELLATION DATE]-[PURCHASE DATE])

I receive an error from Access stating the above is an undefined IF()
statement. The general idea is to calculate sub lengths from active and
cancelled subscribers.

TIA
 
D

Dirk Goldgar

Don said:
I've tried to make an IF() statement in Access' Expression Builder
work like Excel, to no avail. The built-in help in Access didn't
pull up any examples, either. The expression looks like this:

SUB LENGTH: IF(IsNull([MASTER LIST]![CANCELLATION
DATE]),Date()-[PURCHASE DATE],[CANCELLATION DATE]-[PURCHASE DATE])

I receive an error from Access stating the above is an undefined IF()
statement. The general idea is to calculate sub lengths from active
and cancelled subscribers.

The function in Access VBA is IIf() -- "Immediate If", I think it stands
for -- not If().
 
Top