cute
cute

Reputation: 9

search with specific date sql

I want to data for a specific date in SQL.

This is the structure of my db:

I want to get all rows from column 'user' from month '02' as well as day '07'

Upvotes: 0

Views: 1597

Answers (2)

krunal modi
krunal modi

Reputation: 135

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

Upvotes: 0

John K.
John K.

Reputation: 5474

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

Upvotes: 1

Related Questions