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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple date formula

Status
Not open for further replies.

Jacob438

Programmer
Jul 27, 2001
69
US
I have a date parameter that the user inputs

If this date parameter is after today (in the future), I want a formula to return todays date, otherwise, I want to return the date entered.

I will be using this on my report because if the user inputs some stupid date in the future, I don't want that to show up in the header, I want that label to show todays date in the header instead.

Oh, and I want to know how to do this in Crystal Syntax, I can do it in VB syntax, but I need crystal... don't ask :)

thanks,

Jacob
 
nevermind... I think I just got it...woohoo!

here's what I got, in case anybody else has this problem...

if DateDiff(&quot;d&quot;,Date(Year({?End Date}),Month({?End Date}),Day({?End Date})),CurrentDate) < 0 then
CurrentDate
else
Date(Year({?End Date}),Month({?End Date}),Day({?End Date}))


Thanks anyways! :)

Jacob438
 
haha, cool, yeah, much simpler, thanks,

Jacob438
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top