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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top