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
 General SQL Server Forums
 New to SQL Server Programming
 List all Dates between two Date columns of a table

Author  Topic 

hisxlnc
Starting Member

1 Post

Posted - 2011-10-19 : 00:08:35
My table PRODUCT has 3 columns: Product_ID INTRODUCED_DATE WITHDRAWAL_DATE

I need to create a derived table PRODUCT_ALL_DATES from this table that list all the dates that a Product was active.The Date ranges are INTRODUCED_DATE (Start Date) and WITHDRAWAL_DATE(End Date)

How can I achieve this in SQL Server?I have indicated the sample output in the attached image.

http://imgur.com/vOBVa

Thanks!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-19 : 00:12:03
Show us what you have so far so that we can at least see you've tried to do your homework on your own. We are here to help, but not to just give the answer for a homework question/test/interview.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -