• 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).

    The DATEDIFF function takes dates into account, so you'll need to bring the appropriate date column in the calculation.