Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

using CHAR

$
0
0

Hi,

I have a column that I need to use to populate two column. Below is the column that it looks like and I have more that 1 million columns like this that I need to brak down. The column name is description...

Description                                                          Date

Peoplesoft 12/18/2014-12/22/204                    1/7/2016

Travelline  1/1/2016-1/5/2016                          1/7/2016

MC  1/09- 1/12/2016                                        1/7/2016

KM                                                                    1/7/2016

What I am trying to do here is I need to get these two dates from description column and put it in a new columns called From and To. SO the expected result is like..

From                     To

12/18/2014        12/22/204

1/1/2016            1/5/2016

for the first two line I want the above resulut but for the next two line what I want to do is I have another field called date so if the data is in mm/dd format or incomplete date  or blank then I want to grab from that date field. Is that possible to do dynamically? so my last two rows would be ..

From                     To

1/7/2016             1/12/2016

1/7/2016             1/7/2016  


SPPandey



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>