on 03-21-2013 5:52 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.