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 |
|
shinu
Starting Member
2 Posts |
Posted - 2005-06-02 : 03:44:14
|
hi friends...I need a help pls…I have Data in table which has a field named Date. I want to group them and take count on the basis whether they come in the First or second half of a month. There will be only one month at a time. Result will be like this (No Column Name) CountFirstHalf 23344SecondHalf 56753Thanking you, |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-02 : 04:26:14
|
| select 'FirstHalf' ,count(*) as 'Count' from yourTable where day(dateCol)<=15 union allselect 'Second Half',count(*) as 'Count' from yourTable where day(datecol)>15 MadhivananFailing to plan is Planning to fail |
 |
|
|
shinu
Starting Member
2 Posts |
Posted - 2005-06-02 : 05:42:43
|
| There you are da!Thanks a lot Madhivanan. I was planning a big function for this. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-02 : 05:59:45
|
quote: Originally posted by shinu There you are da!Thanks a lot Madhivanan. I was planning a big function for this.
Well shinu. Tell me the place and time MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|