September 28, 2013 at 1:33 am
Hi,
I want to find difference between two times which is in AM PM format. Please suggest any idea how to do that?
Thanks
Abhas
September 28, 2013 at 1:47 am
Convert them to datetime values and use the DATEDIFF function to find the difference.
September 28, 2013 at 2:51 am
Hi Michael,
I tried but value will display same for both AM and PM,
example 07:30 AM and 07:30 PM will display same value as below.
07:30:00.0000000
Thanks,
September 28, 2013 at 4:58 am
Convert them to datetime with the correct format code and use the DATEDIFF function. Don't store dates as varchars, you end up with all sorts of problems if you do so.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply