I am trying to create a new column based on date search result. I have written a code in the link SQL fiddle as I am looking for date automation on each column based on the date format. the date format Coloum can be up to 7 column or less or more, just based on how many dates in the record. [SQL fiddle][1] Here is a screenshot as I would like to get this similar and the data is based on the number of sold SKU. [![enter image description here][2]][2] [1]: http://sqlfiddle.com/#!9/a6c585/1 [2]: https://i.sstatic.net/C8kUp.png