Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

financial date calculation

Avatar

Former Community Member

hi there,

i want to calculate the days between two dates. the problem is, that it has to calculate with the european financial year and month.

means every month has 30 and a year 360 days.

this one on a calculate event works fine for a calender-year:

( Date2Num(DateTimeField2.rawValue,"YYYY-MM-DD") - Date2Num(DateTimeField1.rawValue,"YYYY-MM-DD"))

but is there a function to get the days between a date and the end of the '360-day-year'.

for example:

for this year there are 315 days left (from 16/02/10 to 31/12/10)

thanks

florian

1 Reply

Avatar

Former Community Member

Florian,

The attached example allows you to pick a date. It then parses the year from the date and calculates the date number for Dec. 30th of the given year. Finally, it calculates the difference between Dec. 30th of the given year and the selected date.

However, it does not consider every month to be 30 days. It makes the calculation based upon the date numbers returned by the FormCalc Date2Num function. Additionally, I am not sure how you are going to go about reconciling leap years.

It may give you some ideas.

Steve