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 |
|
fantasimus
Starting Member
4 Posts |
Posted - 2005-10-24 : 12:23:25
|
| hi,i have some rs in a table calanderwith a column named repeat.if a user inserts as rs with a weekly repeat..the value in the column repeat is 7.no i want to query the sql server that he creates for a weekly entry the recordsets automaticallyexample:date repeat header -----------------------------------------2005-10-25 18:00:00 1 john2005-10-25 13:00:00 1 sleeping2005-10-01 18:00:00 7 soccerthe soccer entry should be weekly.. so the result should look like:date repeat header -----------------------------------------2005-10-01 18:00:00 7 soccer2005-10-07 18:00:00 7 soccer2005-10-14 18:00:00 7 soccer2005-10-21 18:00:00 7 soccer2005-10-25 18:00:00 1 john2005-10-25 13:00:00 1 sleeping2005-10-28 18:00:00 7 soccerany idea ? |
|
|
fantasimus
Starting Member
4 Posts |
Posted - 2005-10-25 : 09:06:22
|
| no idea ?should it be solved with temp tables ?does another solution exists ? |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2005-10-25 : 10:04:57
|
| Tricky calendar operations can often be solved by creating a table of sequential numbers in your database, starting with zero and going as high as necessary. This table can then be used to generate a temporary dataset or subquery containing dates beginning with any date you choose and incrementing by any value you want. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|