+ Reply to Thread
Results 1 to 2 of 2

Thread: Calculate difference between two dates in SQL Server

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    3

    Calculate difference between two dates in SQL Server

    How to calculate difference between two dates in SQL Server?

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    4
    select datediff(day, '2012-01-01', getdate()) as no_of_days;
    select datediff(month, '2012-01-01', getdate()) as no_of_months;
    select datediff(year, '2012-01-01', getdate()) as year;

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts