INSERT PERIOD DAY OF DATE TO TABLE

Hi All,

I have below table say TableA :

1. Id --> '01', '02' and etc
2. FromDate (Always Monday)
3. ToDate (Always Sunday).

How could I insert it using constraint from Year 2011 to 2012.

Thank you.

LVL 1
emi_sastraAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you should have or use a calendar table like described here:
http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

from there, this will be "easy", as you can then query that table for years 2011 and 2012, taking only the "mondays", and adding up the 6 days to get the sunday following that monday

hope this helps
0
 
emi_sastraAuthor Commented:
Hi angelIII,

I get it.

Thank you very much for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.