开发者

search with specific date sql

开发者 https://www.devze.com 2023-02-08 21:17 出处:网络
I want to data for a specific date in SQL. This is the structureof my db: Column \'date\'date format \'2011-02-07 09:42:56\'

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

精彩评论

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