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 |
|
ann
Posting Yak Master
220 Posts |
Posted - 2008-02-06 : 15:46:39
|
| I have a query that I need to concantenate a datetime and several int fields into varchars/string.Can someone tell me how to convert the datetime and int field into strings/varchar?Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-06 : 15:56:50
|
A simple SELECT 'ABC' + CAST(Col1 AS VARCHAR(2)) + ':' + CONVERT(VARCHAR(10), GETDATE(), 112)FROM Table1 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
ann
Posting Yak Master
220 Posts |
Posted - 2008-02-06 : 16:10:54
|
| thanks! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-07 : 07:19:48
|
| And as usual if you want to show them in front end application, do concatenation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|