Author |
Topic |
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2004-06-09 : 15:11:05
|
Can one use string concatenation to stack values in a cell, like so:100200from BOL, I see SPACE(1) used, can I call for a hard return somehow?SELECT (au_lname + ',' + SPACE(1) + SUBSTRING(au_fname, 1, 1) + '.') AS Namethx |
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-06-09 : 15:16:00
|
Can do, but why?select '0 ' + char(13) + char(10) + '1' |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-06-09 : 15:17:36
|
damn: sniped DECLARE @au_lname varchar(30), @au_fname varchar(30)SELECT @au_lname = 'Kaiser', @au_fname = 'Brett'SELECT @au_lname + CHAR(13)+CHAR(10) + @au_fname AS NameBrett8-) |
|
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2004-06-09 : 15:23:30
|
thanks all.this output goes to excel, the reason for the stacked format is that the data is more meaningful when displayed this way.J |
|
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2004-06-09 : 16:28:44
|
anyone know how to eliminate the vertical bars once the data is transferred to excel. data looks fine, I just want to search for the vertical bar and replace it with nothing.thx |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-06-09 : 16:30:18
|
How about Replace function in the Edit menu? You can also get to it with Ctrl+H.Tara |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-06-09 : 16:35:20
|
quote: Originally posted by steelkilt anyone know how to eliminate the vertical bars once the data is transferred to excel. data looks fine, I just want to search for the vertical bar and replace it with nothing.thx
Did you pick it as a delimeter?How did you transfer the data?I'm assuming DTS...what object did you pick?Excel, text file?Brett8-) |
|
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2004-06-09 : 16:56:34
|
didn't pick it as a delimitertransferred using DTS to to Excel 8.0thx |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-06-09 : 17:01:12
|
CReATE VIEW myView99ASSELECT Col1, REPLACE(Col2,'|',''), Col3, ectDTS out the viewBrett8-) |
|
|
|