Re: Help concatenating non string fields

Re: Help concatenating non string fields

 

  


Justin,

This should work

select rtrim(convert(char,dbo.id)) + rtrim(convert(char,dbo.ReportsId))

Regards
Christine

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christine Carter
DBA, PricewaterhouseCoopers
Tel: 760 2657 (Internal), +44 (161) 245 2657 (External)
christine.[Email Address Removed]
"Justin Gilli"
<[Email Address Removed] To: "LazyDBA.com Discussion" <[Email Address Removed]
om> cc:
Subject: Help concatenating non string fields
18/12/2003 15:38








I am trying to concat two non sting fields.
For example :

(Dbo.Id) +''+(dbo.ReportsId)
300 5 = 3005

but I am getting the addition of these two (305) instead of them being
appended to each other(3005).
I have tried Cast and converting the values from int to varchar but it
still adds them.

Any advice?


Sincerely,

Justin Gilli









---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Get today's cartoon: http://www.LazyDBA.com
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed] End of message text --------------------

This e-mail is sent by the above named in their
individual, non-business capacity and is not on
behalf of PricewaterhouseCoopers.

PricewaterhouseCoopers may monitor outgoing and incoming
e-mails and other telecommunications on its e-mail and
telecommunications systems. By replying to this e-mail you
give your consent to such monitoring



MS Sql Server LazyDBA home page