--QueryDay:
SELECT * FROM info whereDateDiff (dd,datetime,getdate()) =0 
--Query within 24 hours :  
Select * from info where datediff (Hh,datetime,getdate ()) <=24
-- Query this week 's records
SELECT * from info where datediff (week,datetime,getdate()) =0
-- query this month record
select * from info where datediff (Month,datetime,getdate ()) =0
--info is the table name, DateTime is the field value in the database
DATEDIFF Function:
Grammar:
DATEDIFF (DatePart, StartDate, EndDate)
Note: EndDate minus startdate. If StartDate is later than EndDate, a negative value is returned.
If the result is outside the integer value range, DATEDIFF will produce an error. For milliseconds, the maximum number is 24 days and 20 hours 31分钟零23.647秒. For seconds, the maximum number is 68 years.
Methods that are computed across boundaries such as minutes, seconds, and milliseconds make the result specified by DATEDIFF consistent across all data types. The result is a signed integer value that is equal to the number of datepart boundaries across the first and second days. For example, the number of weeks between January 4 (Sunday) and January 11 (Sunday) is 1.
SQL query day, week, one month statement of data