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!

Confirmation for date formula needed.

Status
Not open for further replies.

stormtrooper

Programmer
Apr 2, 2001
266
CA
Hi there. I have a report that runs at 3am everyday. I have come up with a formula that compensates for the report being run on the last day of a particular month.

Here it is:
If Day(CurrentDate) = 1
Then ({MyDate}) In LastFullMonth
Else Month({MyDate}) = Month(CurrentDate) And
Day({MyDate}) <= Day(CurrentDate) - 1

My question is, since there is no function in CR7 for LastFullYear, how can I get the same result as above pertaining to year instead?

Note: This has to do with fiscal year which is from April 1, 2002 to March 31, 2003 and so on. Also, the report still has to run at 3am everyday.

Thanks
 
Add to the top of your formula... (Assuming Financial Year starts on 1 April)

if month(CurrentDate)=4 and
day(CurrentDate)=1 then
{MyDate}>= Date(Year(CurrentDate)-1,4,1) and
{MyDate} < CurrentDate
else //.... your existing formula
Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top