IIF date statement

L

Lisa

Please help. I am trying to turn all dates equaling 1/1/2000 into N/A’s in
another column if the date is not 1/1/2000 I need to pull that date pulled
over. There can also be blanks in the date 1 column these can come back as
blanks.

Statement I'm using
Test2: IIf([master]![HOC]="1/1/2000","N/A",[master]![HOC])

This comes back with blanks where they should be blanks but errors in any
cell having any dates

Date 1 Test2 (I need)
12/1/2005 12/1/05
1/1/2000 N/A
1/5/2006 1/5/2006

Thank you in advance.
 
K

Ken Snell \(MVP\)

Delimite the date value with # character:

Test2: IIf([master]![HOC]=#1/1/2000#,"N/A",[master]![HOC])
 
J

John Spencer

Assuming that HOC is a date field, you need to delimit it with #
(oglethorpes), not with " (quote marks).

Test2: IIf([master]![HOC]=#1/1/2000#,"N/A",[master]![HOC])

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
L

Lisa

Thank you so much

John Spencer said:
Assuming that HOC is a date field, you need to delimit it with #
(oglethorpes), not with " (quote marks).

Test2: IIf([master]![HOC]=#1/1/2000#,"N/A",[master]![HOC])

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Lisa said:
Please help. I am trying to turn all dates equaling 1/1/2000 into N/A's in
another column if the date is not 1/1/2000 I need to pull that date pulled
over. There can also be blanks in the date 1 column these can come back as
blanks.

Statement I'm using
Test2: IIf([master]![HOC]="1/1/2000","N/A",[master]![HOC])

This comes back with blanks where they should be blanks but errors in any
cell having any dates

Date 1 Test2 (I need)
12/1/2005 12/1/05
1/1/2000 N/A
1/5/2006 1/5/2006

Thank you in advance.
 
L

Lisa

Thank you so much

Ken Snell (MVP) said:
Delimite the date value with # character:

Test2: IIf([master]![HOC]=#1/1/2000#,"N/A",[master]![HOC])

--

Ken Snell
<MS ACCESS MVP>



Lisa said:
Please help. I am trying to turn all dates equaling 1/1/2000 into N/A's in
another column if the date is not 1/1/2000 I need to pull that date pulled
over. There can also be blanks in the date 1 column these can come back as
blanks.

Statement I'm using
Test2: IIf([master]![HOC]="1/1/2000","N/A",[master]![HOC])

This comes back with blanks where they should be blanks but errors in any
cell having any dates

Date 1 Test2 (I need)
12/1/2005 12/1/05
1/1/2000 N/A
1/5/2006 1/5/2006

Thank you in advance.
 

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