IIf expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
If I understand correctly (a few sample records would have helped
understand), you can use:

IIf([END_DATE]=#1/1/1901#, Null, [END_DATE])
 
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.
 
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.
 
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.
 
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.
 

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

Similar Threads


Back
Top