General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Time difference in Calendar Month
I am trying to create a procedure that shows the time difference between 2 dates. I can do this using datediff or dateadd functions, but I need to band the output in calendar months.
Examples below:
Date1 = 29th February 2004
Date2 = 30th January 2004
Date 2 would need to appear in the 2nd month banding, but by using dateadd I get this in the 1st month banding.
Does anyone know how to do this?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only