SQL - Get difference between two dates (by year/month/day)

From GUILLARD WIKI
Revision as of 16:22, 3 May 2018 by Guillard (talk | contribs) (Created page with "<syntaxhighlight lang="sql"> 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)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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-fac_dte_effective+1) || ' Days ' 
"Duration Pricing (fac)"
from 
vls_facility;