You must Sign In to post a response.
  • Category: SQL Server

    How to calculate Minitus

    how to calculate mintues in sql using SP..and View ....
  • #750131
    Your question is not clear.
    from where you have to get difference in minute?
    Is it from two column ,table or from one column and current time?
    Any way you can get difference between two time or two dates by using datediff(MINUTE,'start time','end time')
    select datediff(MINUTE,'04:30','06:30')as [minutes]


    120 MIN.

    Nirav Prabtani (Senior Web Developer)
    Email :
    blog :

  • #750197
    Hi kirubaharan,

    I think your looking for difference between 2 dates in minutes format right.?

    If you are looking for the same then use below sample query

    select datediff(m,@in_time,@out_time);

    Try something like above to achieve your goal..

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #750209

    To find the time difference in minutes, you can use datediff function of sql as below-

    select datediff(MINUTE,'time1','time2')as [minutes]

    Ashutosh Jha

  • #750763

    Use the below sql script

    @ToDate DATETIME

    SELECT @FromDate = '2014-09-02 10:00:00',
    @ToDate = '2014-09-02 12:30:00'

    SELECT CONVERT(VARCHAR(12), DATEADD(minute, DATEDIFF(minute, @FromDate, @ToDate), 0),114)

    SELECT CONVERT(VARCHAR(5), DATEADD(minute, DATEDIFF(minute, @FromDate, @ToDate),0),114)

  • Sign In to post your comments