How to Find Days in Sql Server. [Resolved]

Posted by Jayakumars under Sql Server on 2/1/2016 | Points: 10 | Views : 368 | Status : [Member] [MVP] | Replies : 1
Hi

How to find hours two between date in sql server .

Mark as Answer if its helpful to you


Responses

Posted by: Professionaluser on: 2/1/2016 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved

declare @date1 datetime = '2016-02-01 14:44:41.937' , @date2 datetime = '2016-02-01 16:30:41.937'
SELECT DATEDIFF( HH ,@date1, @date2) NumberOfHours


Output:
NumberOfHours
2


Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response