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 |
|
ninel
Posting Yak Master
141 Posts |
Posted - 2005-06-17 : 17:16:48
|
| The pay period at my company is from sunday to saturday.How can I calculate these pay periods for the next 5 years.Example:StartPeriod EndPeriod20050612 2005061820050619 2005062520050626 20050702Thanks,Ninel |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-06-17 : 18:05:02
|
Using the function in this topic below to give you a table of numbers, this code will do itFunction F_TABLE_NUMBER_RANGEhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47685select StartPeriod = dateadd(dd,NUMBER*7,'2005-06-12'), StartPeriod = dateadd(dd,(NUMBER*7)+6,'2005-06-12')from dbo.F_TABLE_NUMBER_RANGE(0,270)order by NUMBER CODO ERGO SUM |
 |
|
|
|
|
|