USE OLTP
--seperate table for dates
SELECT distinct date
	  ,datepart(year,date) as year
      ,datepart(month,date) as month
	  ,datepart(quarter,date) as quarter
	  ,datepart(day,date) as day
	  ,cast(null as nvarchar(2000)) as notes
INTO times
FROM sales

SELECT * FROM times

--Date information
SELECT s.id,s.retailer_city,s.product_code
       ,t.year,t.month,t.quarter,t.day,t.notes
FROM sales_with_pk as s JOIN times as t ON s.date=t.date
