IIf expression

J

jp77

I have a field in a query that displays dates. I want all of the dates on
1/1/1901 to show up blank and I want all the other dates to be displayed. Can
some one help me? I have tried:

IIf ([END_DATE]=#1/1/1901#," ")

I am worried that the output only shows those blank dates. Do I need to add
some thing to the end of that expression?

Thanks for the help.
 
D

Duane Hookom

If I understand correctly (a few sample records would have helped
understand), you can use:

IIf([END_DATE]=#1/1/1901#, Null, [END_DATE])
 
B

Brendan Reynolds

IIf ([END_DATE]=#1/1/1901#," ", [END_DATE])

The IIf function takes up to three arguments, the condition, the value to
return if the condition evaluates to true, and the value to return if the
condition evaluates to false.
 
J

jp77

Thanks a lot

Brendan Reynolds said:
IIf ([END_DATE]=#1/1/1901#," ", [END_DATE])

The IIf function takes up to three arguments, the condition, the value to
return if the condition evaluates to true, and the value to return if the
condition evaluates to false.

--
Brendan Reynolds
Access MVP


jp77 said:
I have a field in a query that displays dates. I want all of the dates on
1/1/1901 to show up blank and I want all the other dates to be displayed.
Can
some one help me? I have tried:

IIf ([END_DATE]=#1/1/1901#," ")

I am worried that the output only shows those blank dates. Do I need to
add
some thing to the end of that expression?

Thanks for the help.
 
D

Duane Hookom

I'm not sure you want to have an IIf() expression that might return either a
date value or a string. I prefer to return Null rather than " ". There is a
significant difference between Null and " ".
--
Duane Hookom
MS Access MVP

jp77 said:
Thanks a lot

Brendan Reynolds said:
IIf ([END_DATE]=#1/1/1901#," ", [END_DATE])

The IIf function takes up to three arguments, the condition, the value to
return if the condition evaluates to true, and the value to return if the
condition evaluates to false.

--
Brendan Reynolds
Access MVP


jp77 said:
I have a field in a query that displays dates. I want all of the dates
on
1/1/1901 to show up blank and I want all the other dates to be
displayed.
Can
some one help me? I have tried:

IIf ([END_DATE]=#1/1/1901#," ")

I am worried that the output only shows those blank dates. Do I need to
add
some thing to the end of that expression?

Thanks for the help.
 
B

Brendan Reynolds

Good point, Duane. If the result is used as the input to another expression,
the difference could be important.

--
Brendan Reynolds
Access MVP

Duane Hookom said:
I'm not sure you want to have an IIf() expression that might return either
a date value or a string. I prefer to return Null rather than " ". There
is a significant difference between Null and " ".
--
Duane Hookom
MS Access MVP

jp77 said:
Thanks a lot

Brendan Reynolds said:
IIf ([END_DATE]=#1/1/1901#," ", [END_DATE])

The IIf function takes up to three arguments, the condition, the value
to
return if the condition evaluates to true, and the value to return if
the
condition evaluates to false.

--
Brendan Reynolds
Access MVP


I have a field in a query that displays dates. I want all of the dates
on
1/1/1901 to show up blank and I want all the other dates to be
displayed.
Can
some one help me? I have tried:

IIf ([END_DATE]=#1/1/1901#," ")

I am worried that the output only shows those blank dates. Do I need
to
add
some thing to the end of that expression?

Thanks for the help.
 
Top