Subject | How to count leap days from date range. |
---|---|
Author | Roland Turcan |
Post date | 2009-02-11T20:13:01Z |
Hello firebird-support@yahoogroups.com!
I have two dates and I need to count, that how many times occured
29.2. between two days.
Why:
I need to calculate year interest, but:
INTEREST_AMOUNT = ISTINA * (DATE_FROM - DATE_TO + 1) * INTEREST / 365 / 100;
...increases the count of days with leap days which gives wrong
computation.
How could I solve this computation using FireBird 2.1 with dialect 3
in stored procedure, but WITHOUT creating any new UDF funtion.
Thanks for all hints in advance.
--
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk
I have two dates and I need to count, that how many times occured
29.2. between two days.
Why:
I need to calculate year interest, but:
INTEREST_AMOUNT = ISTINA * (DATE_FROM - DATE_TO + 1) * INTEREST / 365 / 100;
...increases the count of days with leap days which gives wrong
computation.
How could I solve this computation using FireBird 2.1 with dialect 3
in stored procedure, but WITHOUT creating any new UDF funtion.
Thanks for all hints in advance.
--
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk