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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 create/add dynamic recordset: calander

Author  Topic 

fantasimus
Starting Member

4 Posts

Posted - 2005-10-24 : 12:23:25
hi,
i have some rs in a table calander
with 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 automatically

example:
date repeat header
-----------------------------------------
2005-10-25 18:00:00 1 john
2005-10-25 13:00:00 1 sleeping
2005-10-01 18:00:00 7 soccer


the soccer entry should be weekly..

so the result should look like:
date repeat header
-----------------------------------------
2005-10-01 18:00:00 7 soccer
2005-10-07 18:00:00 7 soccer
2005-10-14 18:00:00 7 soccer
2005-10-21 18:00:00 7 soccer
2005-10-25 18:00:00 1 john
2005-10-25 13:00:00 1 sleeping
2005-10-28 18:00:00 7 soccer

any 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 ?
Go to Top of Page

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.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-25 : 10:14:45
See if this helps you
http://sqlteam.com/forums/topic.asp?TOPIC_ID=44865

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -