Difference between two date timestamps month wise and year wise

suggest change

Monthwise difference between two dates(timestamp)

select 
    (
        (DATE_PART('year', AgeonDate) - DATE_PART('year', tmpdate)) * 12 
        +
        (DATE_PART('month', AgeonDate) - DATE_PART('month', tmpdate))
    ) 
from dbo."Table1"

Yearwise difference between two dates(timestamp)

select (DATE_PART('year', AgeonDate) - DATE_PART('year', tmpdate)) from dbo."Table1"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents