Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
prashant6388
Starting Member
1 Post |
Posted - 2009-12-12 : 00:54:10
|
| i hav table(emp) with some records having attribute date with data type date-time.(e.g. 11/12/2005, 16/11/2008, 29/12/2005 in dd/mm/yyyy )now i want to find the records with month=11;suggest me a query. |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-12-12 : 01:03:08
|
| Hi, Try this onceselect * from table where datepart(mm,datecolumn) = 11 |
 |
|
|
learntsql
524 Posts |
Posted - 2009-12-13 : 23:25:42
|
| DECLARE @iMonthNo intSET @iMonthNo = 11SELECT *FROM <Table>WHERE MONTH(<DateColumn>)=@iMonthNo |
 |
|
|
|
|
|