null values and dates

D

Derek Davlut

I was wondering if you may be able to help me with a problem. I currently
have a custom form created that has three start dates on it, I want the to
create a field that has the earliest startdate of the three fields. The
problem is at times the start dates have null values from not being set or
used. The fields have the following names

700actual
340actual
300actual

I used an IIF statement in a field "initial value" statement and passed that
to another field but whenever a null value exists from the two fields from
the first field the second IIF statement does not work.

1st Field Name: firstearliestdatequery:
IIF([700actual]<[340actual],[700actual],[340actual])

2nd Field Name finalearliestquery:
IIF([firstearliestquery]<[300actual],[firstearliestquery],[300actual])

It works only if 700actual and 340actual have at least one date set, so I
need help with the null values.

Thanks.

Derek.
 
K

Ken Slovak - [MVP - Outlook]

A date field in Outlook never is null, a null date is #1/1/4501#. You can
test for earlier dates by using the DateDiff() function. Look up that
function in the Help in the Outlook VBA to see how to use it. You can set a
test interval of whatever you want, such as days or hours or whatever.
 

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