Difference between revisions of "SQL - Get difference between two dates (by year/month/day)"

From GUILLARD WIKI
Jump to navigation Jump to search
(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)...")
 
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(Months_Between(fac_dte_final_mat+1,fac_dte_effective)) ||' Months '||
trunc(Months_Between(fac_dte_final_mat+1,fac_dte_effective)) ||' Months '||
Trunc(fac_dte_final_mat-fac_dte_effective+1) || ' Days '  
trunc(fac_dte_final_mat-fac_dte_effective+1) || ' Days '  
"Duration Pricing (fac)"
"Duration Pricing (fac)"
from  
from  

Revision as of 16:23, 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-fac_dte_effective+1) || ' Days ' 
"Duration Pricing (fac)"
from 
vls_facility;