invalid syntax

C

CHW

Help please.

Access 97 query expression.
SSD and PSD are date fields in my database.

If SSD is not null and SSD>PSD, I want to display PSD. Otherwise I want to
display SSD.

I have tried several versions of the following:

iif(and(ssd is not null,ssd>psd),psd,ssd)

but I continue to receive the "invalid syntax...." error message.

Thanks in advance.

CHW
 
F

fredg

Help please.

Access 97 query expression.
SSD and PSD are date fields in my database.

If SSD is not null and SSD>PSD, I want to display PSD. Otherwise I want to
display SSD.

I have tried several versions of the following:

iif(and(ssd is not null,ssd>psd),psd,ssd)

but I continue to receive the "invalid syntax...." error message.

Thanks in advance.

CHW

You might want to look up the correct syntax for IIF in VBA help?
=IIf(Criteria,True Value,False Value)

=IIf(Not IsNull([SSD]) and [SSD] > [PSD],[PSD],[SSD])

But how can you expect to display [SSD] if [SSD] Is Null?
Your logic doesn't make much sense to me.
 
C

CHW

If SSD is null or SSD<PSD, I want to display PSD.

The database will be used to record security transactions and either
SSD(Sale Settlement Date) or PSD (Purchase Settlement Date) can be null but
not both.

I want to display trades as executed. Short sale and purchase, purchase and
sale or position executed and left open.

Help is appreciated.

CHW.
 

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