Hi Experts. I have a client with separate date and time fields: StartDate and StartTime, and EndDate and EndTime.
I need to calculate the difference between the two in hours and minutes (and potentially across multiple days) - and am not sure the best way to do this. Also - since converting to SQL Server - when I open the ODBC connected table from the Access side the date fields are MM/DD/YYYY - while on the SQL Server side it's a DateTime field and shows the time.
It doesn't appear that the time in the field matches the time field itself so I don't know how accurate it is since the conversion.
I was reading up on this function to combine the two fields but am not sure how to implement it -- DATEDIFF(hour,cast(StartDate +StartTime as datetime),cast(EndDate +EndTime as datetime))
I'm also wondering if I should create a stored procedure to perform this function once decided on (since I need to go back and recalcuate the history since the last developer wound up with negative results instead of positive.
Looking for some ideas, suggestions, direction. Thanks all.