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)
 Marking Calender table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-03-10 : 07:42:46
RT writes "I am trying to make a table which should have month as well as week also and if some activity occour in some particular week or month it should reflect in database. I am a beginner in SQL server plz help me out."

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-10 : 09:14:04
have a permanent table od dates say from 1990 to 2040 by day.
then you have another table in which you reflect your activites and there you have a datetime column which you can join
to the permanent table od dates. weeks can be obtained from the date by using DATEPART function:
SELECT DATEPART(wk, GETDATE()) gets you the week number today is in.


Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -