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 |
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-03-25 : 10:58:46
|
| Hellow.Got the following data: 03/24/20080000565172. The first 10 digit is the date. I need to pull the date in the following format- 20080324 (yyymmdd) from 03/24/20080000565172 data-- how do u doThkJosephine |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-25 : 11:15:28
|
SELECT SUBSTRING(Col1, 7, 4) + SUBSTRING(Col1, 1, 2) + SUBSTRING(Col1, 4, 2)FROM Table1 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-03-25 : 11:27:09
|
Perfect. Thank for your helpquote: Originally posted by Peso SELECT SUBSTRING(Col1, 7, 4) + SUBSTRING(Col1, 1, 2) + SUBSTRING(Col1, 4, 2)FROM Table1 E 12°55'05.25"N 56°04'39.16"
Josephine |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-02 : 06:31:23
|
| orselect convert(varchar(8),cast(left(col,10) as datetime),112) from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-04-02 : 06:34:46
|
quote: Originally posted by madhivanan orselect convert(varchar(8),cast(left(col,10) as datetime),112) from your_tableMadhivananFailing to plan is Planning to fail
Think this question is already answered.And that won't work necessarily.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-02 : 11:32:32
|
Well, Madhi has been occupied lately  E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|
|
|