I am using datediff to get the difference between two datetimes:
DATEDIFF(hh, CAST(CAST(dbo.QuickLabDump.[Date Entered] AS DATE) AS DATETIME)
+ CAST(dbo.QuickLabDump.[Time Entered] AS TIME),
CAST(CAST(dbo.QuickLabDump.[Date Completed] AS DATE) AS DATETIME)
+ CAST(dbo.QuickLabDump.[Time Completed] AS TIME)) AS [Hours TurnAround]
I don’t understand the behavior that I am getting from this statement but what I need is anything that is >= :30, round up, if not, round down,
question how do I get it to round down when less than 30 minutes and round the hours up if greater or equal to 30 minutes?
You should calculate the
DATEDIFFin minutes and do aROUNDthen: