September 26, 2007 at 11:25 am
The function in this link may provide you with the appropriate information...
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519&SearchTerms=F_TABLE_DATE
Else you may find the following useful..
http://www.intelligententerprise.com/db_area/archives/1999/992112/celko.jhtml
hope this helps.
-Luke.
September 26, 2007 at 1:58 pm
Luke: I did find that one I just do not know what to change to have it create a table not a function.
September 27, 2007 at 7:51 am
Like any other function that returns a table, you should be able to use the function to create a permanent table...
[font=Courier New]
SELECT *
INTO dbo.newdatetable
FROM dbo.F_TABLE_DATE(somestartdate,someenddate)[/font]
My concern is... what do you think you're going to use a date table for? Except for the actual date column, if you're trying to resolve batches as opposed to single row GUI stuff, you may be in for a very rude awakening...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 27, 2007 at 8:00 am
And, here's a good article by the gent that got me interested in Tally tables a thousand years ago... just remember, he doesn't really explain how to do the "business days between two dates" trick for batch code in a high performance manner... no one does for date tables (think about that)... 😉 but it does work for RBAR GUI stuff...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply