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 |
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2010-07-14 : 04:43:10
|
HiI have data like this 14072010. i need to convert14/07/2010 or 2010/07/14 datetime formathelp on this..thanks a lot |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-07-14 : 04:48:47
|
Is the date stored as integer or varchar right now? N 56°04'39.26"E 12°55'05.63" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-07-14 : 04:49:39
|
SELECT STUFF(STUFF(Col1, 3, 0, '/'), 6, 0, '/') N 56°04'39.26"E 12°55'05.63" |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-07-14 : 04:56:44
|
Hi Peso,that's fine.I've never had the idea to use STUFF() with a length of zero to have a string-insert. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
WoodHouse
Posting Yak Master
211 Posts |
Posted - 2010-07-14 : 05:05:42
|
Hi pesoIts Varchar field |
|
|
ramecepa
Starting Member
43 Posts |
Posted - 2010-07-14 : 05:59:55
|
Hi Convert(varchar(10),fieldname,103)----dd/mm/yyyySELECT convert(datetime, '2016/10/23', 111) -- yyyy/mm/dd |
|
|
|
|
|