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!

Formula - dates greater then 3 yrs

Status
Not open for further replies.

Jeffs23

Programmer
May 20, 2013
8
US
I have a field in my report called {Last Visit Date}.

What I would like to do is return a phrase if this field is greater the 3 yrs old. For Example, if the date thats returned to this field is : 04/01/2008, I would like it to return a phrase like "Greater then 3 yrs old" if its NULL or under 3 years then "Less then 3 years old"
 
Try:

Code:
If	IsNull({Last Visit Date})
Then	'Less than 3 years old' 
Else
If	{Last Visit Date} < Date(Year(CurrentDate)-3, Month(CurrentDate), Day(CurrentDate))
Then	'Greater than 3 years old'
Else	'Less than 3 years old'

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top