cancel
Showing results for 
Search instead for 
Did you mean: 

How to split the column

Bhargavakrishna
Active Contributor
0 Kudos

Hi,

We have a Column called Event_Date in SQL server 2008. The data is recording in this format YYYY-MM-DD HH:MM:SS:MS.  i want the data in such away that, the date should be in one column and the Time should be in another column. The Date should be saved in this format.

Date: DD-MM-YYYY

Time: HH:MM

Can someone guide me how to achieve this?

View Entire Topic
former_member184789
Active Contributor
0 Kudos

Hi, first separate YYYY-MM-DD from HH:MM:SS:MS by having substring (0,9) for YYYY-MM-DD & (10,14) for HH:MM:SS:MS since you only need HH:MM. Map the subtsing (10,14) directly to the field to store HH:MM & for the date field after substring(0,9) apply the date function to change the input date format of YYYY-MM-DD into DD-MM-YYYY

Bhargavakrishna
Active Contributor
0 Kudos

Thank you Adarsh.. my issue resolved:)

Bhargavakrishna
Active Contributor
0 Kudos

Thank you all.. my issue resolved..

former_member184789
Active Contributor
0 Kudos

You are welcome