Sql Server Function - 0 hours today to the current time

Asked

Viewed 44 times

1

Please select the amount of hours in regression until 00:00 hours in Sql Server, always of the current day. I get this through a function like 'DATEADD'?

Ex: Now it is 15:00 hrs would like to pick up the amount of hours from 00:00 hrs today to the current time Getdate(). What would work is as clear as the last 15 hours.

I hope you made me understand, I thank you!

  • 1

    Rodolfo, from what I understand the result will always be the current time, so I believe you can use the function Datepart(hour, current_timestamp)

  • Mooonstro, thank you very much... was exactly that.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.