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
 SQL Server Development (2000)
 Make temporary table of consecutive dates

Author  Topic 

TimSinnott
Starting Member

48 Posts

Posted - 2005-08-22 : 22:14:33
Using a stored procedure, I need to create a temporary table of dates in a given month. In other words, if I pass in parameters of BeginDate as August 1, 2005 and EndDate as August 31, 2005, the stored procedure would return a list of the dates in that month, in other words 31 records, for a temporary table.

Any ideas or thoughts will be appreciated.

Tim

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-08-22 : 22:39:54
I have had to use a calendar table to do things like this in the past. Check out this article, it is well written and you can probably use this code as the basis to solve your problem.


http://www.aspfaq.com/show.asp?id=2519



-ec
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-23 : 01:13:43
Refer this also
http://sqlteam.com/forums/topic.asp?TOPIC_ID=44865

Madhivanan

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

TimSinnott
Starting Member

48 Posts

Posted - 2005-08-23 : 09:32:15
eyechart - Yes, I think I can use some of this code directly to solve my problem. Many thanks.

madhivinan - I'm surprised that puzzle was even solvable. That too will help me. Thanks very much.

Tim
Go to Top of Page
   

- Advertisement -