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 |
julius.delorino
Starting Member
29 Posts |
Posted - 2012-06-05 : 11:19:11
|
good sir, may i ask how to get the number of weeks in a month:example :Month number_of_weeksFeb 4Mar 5Apr 4May 4how can you write this in SQL? thanks to all! |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-06-05 : 11:40:53
|
How do you define the number of weeks in a month? Number of days divided by 7?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2012-06-05 : 12:34:47
|
You will have to provide an exact definition of the weeks and months for your organization before anyone can help you. Weeks and months are two different types of time periods.Weeks are normally defined as 7 days starting on a particular day of week, but that varies widely from one organization to the next.Months cannot be evenly divided into weeks, except for non-leap year Feb. Even the definition of month may vary form one organization to another.CODO ERGO SUM |
 |
|
|
|
|