开发者

search with specific date sql

I want to data for a specific date in SQL.

This is the structure of my db:

  • Column 'date' date format '2011-02-07 09:42:56'

I want to get all rows from column 'user' from month '02' as well as day '07开发者_如何学运维'


select * 
from datesTable 
where ((DATEPART(mm, date) = 2) and (DATEPART(dd, date) = 7)) 


SELECT DATEPART(yyyy,clmDate) AS n_Year,
DATEPART(mm,clmDate) AS n_Month, 
DATEPART(dd,clmDate) AS n_Day     
FROM tblName
WHERE ' write condition' 

get Only Month , date and year Details

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜