How to find the data in the morning and afternoon in sqlserver
This article mainly shows you "how to find the morning and afternoon data in sqlserver", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to find the morning and afternoon data in sqlserver".
The DATEPART () function returns a separate part of the date / time, such as year, month, day, hour, minute, and so on.
The DATEDIFF () function returns the time difference between two dates.
-- find the data of that morning select * from R_Attendance where (datepart (hour,RDatetime) > = 0 and datepart (hour,RDatetime) 12 and datepart (hour,RDatetime))