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

Need help with YTD formula

Status
Not open for further replies.

hbarbs

Instructor
Mar 20, 2006
19
0
0
US
I am very new to Crystal and I have a question that I hope has a pretty easy answer. I am using Crystal 8.5. I have a Commitment(Pledge) $ amount for the year. I need to put in what the Commitment $ to date would be based on the date parameters of the report. So, for example...

Commitment $100,000

Running report today, April 2nd with Fiscal YTD as date range(FY starts Feb). The commitment to date would be $24,931.51 based on taking the commitment total dividing it by 365 and multiplying it by the number of days that have passed in the FY. Is there any way to create a forumla for this.

Any help would be great! Thanks a bunch!!!
 
Dividing by 365 wouldn't work as we have leap years.

To determine this sort of thing, you might use a formula such as:

whileprintingrecords;
numbervar daysoftheyear:=datediff("d",cdate(year(currentdate),2,1),cdate(year(currentdate)+1,2,1)-1);
numbervar DailyAmount:={?Yearly Amount}/daysoftheyear;
DailyAmount*datediff("d",{?StartDate),{?EndDate})

I don't have Crystal handy to test with, but the theory seems sound enough.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top