Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF formula to produce a date

Status
Not open for further replies.

BlueHorizon

Instructor
Jan 16, 2003
730
0
0
US
Hi,

I appreciate any help with an IIF formula. I have a date in the [dtmOrdDate] field. I want to produce a report that displays today's date if today is [dtmOrdDate] plus 30 days. Otherwise, "" (blank). Here's what I've tried but it isn't working:

=IIf(Date()=[dtmOrdDate]+30,[dtmOrdDate],"")

Thanks in advance!

Best,
Blue Horizon/Kathy

Best,
Blue Horizon [2thumbsup]
 
Hi,

What does "it isn't working" actually mean, in particular?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
IMO, I don't care for expressions that might return different data types. Your expression might return a date or a string. I would try.

Code:
=IIf(Date()=[dtmOrdDate]+30,[dtmOrdDate],NULL)

Duane
Hook'D on Access
MS Access MVP
 
Thanks, DHookam, NULL worked. I'm usually OK with "" to return a blank but not in this instance.

Good day!
Kathy

Best,
Blue Horizon [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top