March 3, 2011 at 10:34 am
Hello,
I am trying to add to fields together and I get space between them,how can I remove the space?
My results:
5413 6955016
I want these 2 values like this:
54136955016
Thank you
March 3, 2011 at 10:38 am
would you please provide the sample data you'd like to concatenate?
Something like
SELECT 'abc','def'
Also, please include your current approach.
March 3, 2011 at 10:41 am
SELECT filed1 + field2 AS 'BU'
FROM table
Result
5413 6955016
March 3, 2011 at 10:50 am
Since I don't know where the blank is coming from (presumably because Field1 is defined as CHAR(5), but it's also possible that the value of field2 starts with a blank) I added both options:
SELECT RTRIM(filed1) + LTRIM(field2) AS 'BU'
FROM table
March 3, 2011 at 10:53 am
Thank you
March 3, 2011 at 12:31 pm
how would I add one space between them?
Thank you
March 3, 2011 at 12:43 pm
March 3, 2011 at 12:47 pm
I just need one space, I have 13 spaces between them
March 3, 2011 at 1:01 pm
Use
select field1 + ' ' + field2
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply