Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Nomadic
Starting Member
2 Posts |
Posted - 2008-10-06 : 16:41:19
|
I am trying to format a date/time column for company table. Records that were uploaded from our old database has the following format20080117 (no spaces , no dashes , no nothing in between, it is a string)New records that're created in the new database has the following formatJan 17 2008 4:26PMHow can I format this column so all of them look the same? |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-10-06 : 16:42:29
|
CONVERT(DATETIME, Col1, 112) E 12°55'05.63"N 56°04'39.26" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-10-06 : 16:43:30
|
They will converted automatically when inserted into new column which has datetime datatype. E 12°55'05.63"N 56°04'39.26" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-07 : 06:08:10
|
Use Datetime datatype to store dates and leave front end application do the formationMadhivananFailing to plan is Planning to fail |
 |
|
Nomadic
Starting Member
2 Posts |
Posted - 2008-10-07 : 09:10:08
|
Thanks for your answers Peso and Madhivanan. Peso,How am I going to insert them into new column which has datetime datatype.? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-07 : 09:24:49
|
insert into target_table(cols, date_column)select cols,CONVERT(DATETIME, Col1, 112) from source_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|