Hi Lbass,
I have used the first piece of code you posted "date(year({table.date}+275),3,31)" and this has worked a dream.
I am producing a report to idenfiy clients that can be archived or deleted off the live database.
When a client reaches 25 they need to be marked for archiving from the first day of the next fiscal year. Records are archived for 7 years years. After 7 years the clients records are deleted.
I have produced an end date to mark the 7th year anniversary by using code based on the start of the fiscal year.
I have a number of formulas.
Ageat25:
dateadd("yyyy",25,{user.DOB})
archive_startdate: (your code)
date(year({@Ageat25}+275),4,01)
archive_enddate:
dateadd("yyyy",+7,{@archive_startdate})
status:
if {@archive_enddate} < CurrentDate then "to be deleted" else
if {@archive_enddate} >= CurrentDate then "Archived"
I would like to filter the report by status to produce 2 lists of userids. However when I use the status code in my select statement I get an error:
"Date must be between year 1 and year 9999"
the report lists 40K plus records, I suspect I may have a record with an invalid formatted DOB or missing dob, is there any way to trap this?
Many thanks
start date
dateadd("yyyy",+3,{@archive_startdate})