How to Find out Time in Sql server [Resolved]

Posted by Jayakumars under .NET Certifications on 1/9/2017 | Points: 10 | Views : 1740 | Status : [Member] [MVP] | Replies : 2
Hi

EMPID DateTime
1001 30/01/2016 08:15:16
1002 30/01/2016 12:16:35
1003 29/01/2016 08:15:55

How to Time format filtered in Sql Query for ex: grater than 09:00:00

i need output this

EMPID DateTime
1002 30/01/2016 12:16:35

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: Bandi on: 1/10/2017 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
SELECT * FROM TableName WHERE CONVERT(VARCHAR(8),datetimes,108) > '09:00:00' 


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

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

Posted by: Sheonarayan on: 1/9/2017 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
You can use Cast or Convert function of Sql Server

SELECT CONVERT(VARCHAR(8),GETDATE(),108)

To get other date parts you can use DateName or DatePart functions as shown at http://techfunda.com/howto/170/return-week-day-name-week-day-and-month-name

Thanks


Regards,
Sheo Narayan
http://www.dotnetfunda.com

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

Login to post response