calculating time difference

  • Hello,

    I have a problem where i want to get the diffrence in minutes between two times, my datatype is TIME, i have also used the function below

    ABS(DATEDIFF (MINUTE, cd.StartTime , p.StartTime)) AS MinuteDiff.

    the problem is, where i have a cd.startime of 19:00:00 and a p.startime of 00:00:00, it returns 1140 minutes (19hrs) as the minute difference, how can i get the minute difference appropriately as (300 minutes=5hrs) this is the appropriate difference between 19:00 and 00:00(being 12 am).

    I learn from the footprints of giants......

  • JALLYKAMOZE (8/30/2016)


    Hello,

    I have a problem where i want to get the diffrence in minutes between two times, my datatype is TIME, i have also used the function below

    ABS(DATEDIFF (MINUTE, cd.StartTime , p.StartTime)) AS MinuteDiff.

    the problem is, where i have a cd.startime of 19:00:00 and a p.startime of 00:00:00, it returns 1140 minutes (19hrs) as the minute difference, how can i get the minute difference appropriately as (300 minutes=5hrs) this is the appropriate difference between 19:00 and 00:00(being 12 am).

    Please don't post the same question in multiple forums. It only fragments the help you receive. Please post replies to http://www.sqlservercentral.com/Forums/Topic1813801-3740-1.aspx.

  • Ed Wagner (8/30/2016)


    JALLYKAMOZE (8/30/2016)


    Hello,

    I have a problem where i want to get the diffrence in minutes between two times, my datatype is TIME, i have also used the function below

    ABS(DATEDIFF (MINUTE, cd.StartTime , p.StartTime)) AS MinuteDiff.

    the problem is, where i have a cd.startime of 19:00:00 and a p.startime of 00:00:00, it returns 1140 minutes (19hrs) as the minute difference, how can i get the minute difference appropriately as (300 minutes=5hrs) this is the appropriate difference between 19:00 and 00:00(being 12 am).

    Please don't post the same question in multiple forums. It only fragments the help you receive. Please post replies to http://www.sqlservercentral.com/Forums/Topic1813801-3740-1.aspx.

    I apologise,, id take this down. thanks

    I learn from the footprints of giants......

  • Post moved to the other thread

    😎

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply