Test for a null date

G

Guest

I am getting an #error display on the following function in a control on a
report

=IIf(IsNull([Projected Start Date]),"",[Projected Start Date])

Why?

[Projected Start Date] is a date field that may not have a date entered,
hence my test. My ultimate goal is to add text to the date field printout,
but leave the line blank so that I can collapse the line in the report if no
date exists, but print out text for the date if a date does exist.
 
G

Guest

If the name of the text box, that has this IIf, name is "Projected Start
Date" you'll need to change it to something else or you'll get an error.

But why do you need to set the Null to Empty ("")?

Leave it bound to the field in the table and set the CanShrink property of
the text box and of the section where this text box located in, to Yes.
 
G

Guest

If I set the can shrink property to YEs, that will indeed work as far as the
date control itself. The problem is that I have a text box to the immediate
left of it with a label indicating the nature / name of the date- Projected
Start Date. This label box will not shrink along with the data field,
negating the value of the "can shrink"

I need not only the control Projected Start Date to shrink if empty, but
also the label to its immediate left to shrink along with it.

Thanks


Ofer Cohen said:
If the name of the text box, that has this IIf, name is "Projected Start
Date" you'll need to change it to something else or you'll get an error.

But why do you need to set the Null to Empty ("")?

Leave it bound to the field in the table and set the CanShrink property of
the text box and of the section where this text box located in, to Yes.

--
Good Luck
BS"D


Flick Olmsford said:
I am getting an #error display on the following function in a control on a
report

=IIf(IsNull([Projected Start Date]),"",[Projected Start Date])

Why?

[Projected Start Date] is a date field that may not have a date entered,
hence my test. My ultimate goal is to add text to the date field printout,
but leave the line blank so that I can collapse the line in the report if no
date exists, but print out text for the date if a date does exist.
 
G

Guest

Your solution worked by the way. Thanks. And I now have the effect I wanted
as specified in my other reply.

Thanks again





Ofer Cohen said:
If the name of the text box, that has this IIf, name is "Projected Start
Date" you'll need to change it to something else or you'll get an error.

But why do you need to set the Null to Empty ("")?

Leave it bound to the field in the table and set the CanShrink property of
the text box and of the section where this text box located in, to Yes.

--
Good Luck
BS"D


Flick Olmsford said:
I am getting an #error display on the following function in a control on a
report

=IIf(IsNull([Projected Start Date]),"",[Projected Start Date])

Why?

[Projected Start Date] is a date field that may not have a date entered,
hence my test. My ultimate goal is to add text to the date field printout,
but leave the line blank so that I can collapse the line in the report if no
date exists, but print out text for the date if a date does exist.
 

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