Skip to content
Advertisement

How to convert average time returened from sql query to minutes [closed]

I am running the following query

and getting the correct result from sql as ” 00:19:35.6000 ”

I need to get result in total minutes Like 20

Advertisement

Answer

In this part of your SQL, you convert the total seconds into a time, which is why you get your output as time:

Instead of converting the result back to a time, just divide the seconds by 60 and round the number to get the total minutes:

In your original SQL statement:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement