Difference between revisions of "SQL - Get difference between two dates (by year/month/day)"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
select | select | ||
trunc(months_between(fac_dte_final_mat+1,fac_dte_effective) /12) ||' Years '|| | trunc(months_between(fac_dte_final_mat+1,fac_dte_effective) /12) ||' Years '|| | ||
trunc( | trunc(months_between(fac_dte_final_mat+1,fac_dte_effective)) ||' Months '|| | ||
trunc(fac_dte_final_mat-fac_dte_effective | trunc(fac_dte_final_mat+1-fac_dte_effective) || ' Days ' | ||
"Duration Pricing (fac)" | "Duration Pricing (fac)" | ||
from | from |
Latest revision as of 16:25, 3 May 2018
select
trunc(months_between(fac_dte_final_mat+1,fac_dte_effective) /12) ||' Years '||
trunc(months_between(fac_dte_final_mat+1,fac_dte_effective)) ||' Months '||
trunc(fac_dte_final_mat+1-fac_dte_effective) || ' Days '
"Duration Pricing (fac)"
from
vls_facility;