date difference in months calculation should be simple and just by one function.

The current Postgresql provides calculation to find date difference in months by getting (year difference * 12 )+ Months difference. This calculation gives integer number of months. 

but if we want to have months difference in decimal, we will have to add days difference also in calculation, which becomes super lengthy way to calculate just Months difference of 2 dates.

addition to it, if we are deriving date_from and Date_to by some addition calculation, we have to repeat the same in all three stages.

Is there any simple way/simple function like DATE_DIFF in sql to calculate date difference. if not available, i would suggest to consider making one for next release. this will make developers life easier.

Parents Reply Children
No Data