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!

January 1 of current year - 90 formula 1

Status
Not open for further replies.

SJW78

Technical User
Oct 29, 2008
9
CA
Hello,
I'm trying to create a report that will return accounts for clients who are older than 90 years as of January 1st.
So far I've been able create the formula to get current year - 90 but I haven't been able to figure out how to add the January 1st requirement?? Here is the I have so far

((DatePart ("yyyy", {CUSTOMER.DOFB})<=(DatePart("yyyy",CurrentDate)-90)))

Can anyone tell me how to build this formula so that the report is only returning accounts where the client was older than 90 on January 1st of the current year?

Any help would be greatly appreciated!

Thanks.
 
Try this

((DatePart ("yyyy", {CUSTOMER.DOFB})<=(DatePart("yyyy",date(year(CurrentDate),1,1))-90)))
 
In simpler terms, try this

{CUSTOMER.DOFB} <= Dateserial(year(CurrentDate)-90,1,1)
 
That worked perfectly! Thank you kskid : )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top