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 |
|
Ali T
Starting Member
22 Posts |
Posted - 2008-08-05 : 04:39:06
|
| Dear all i have a table by the name of case1 with a date column by the name of date.the date is from 1/1/2008 to 1/3/2008 (d/m/y). i want to write a query that gives me the rows for the first month of 2008.what should i do?Ali T |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-08-05 : 04:48:13
|
| select * from table where month(date)=1 -- maybe: and year(date)=2008Webfred |
 |
|
|
harlingtonthewizard
Constraint Violating Yak Guru
352 Posts |
Posted - 2008-08-05 : 05:04:35
|
| This may give you some ideas.http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=107666 |
 |
|
|
Ali T
Starting Member
22 Posts |
Posted - 2008-08-05 : 05:22:53
|
quote: Originally posted by webfred select * from table where month(date)=1 -- maybe: and year(date)=2008Webfred
thank you so much my friend. it worked. |
 |
|
|
|
|
|