RE: Help concatenating non string fields

RE: Help concatenating non string fields

 

  



You must explicitly convert each field to a char or varchar before
concatinating. Please lookup convert or cast in BOL

Erwin Sloboda
Database Specialist, Database Services Group
Assante Advisory Services Ltd.
416-535-3792, 416-569-7089
Toronto, ON


-----Original Message-----
From: Justin Gilli [mailto:[Email Address Removed]
Sent: Thursday, December 18, 2003 10:39 AM
To: LazyDBA.com Discussion
Subject: Help concatenating non string fields


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] All e-mail to or from this address is recorded by Assante
and is subject to archival, monitoring and/or review, by and/or disclosure
to, someone other than the recipient. This message is intended only for
the persons to whom it is addressed. It may contain information that is
privileged and confidential. If you are not the intended recipient, please
contact the sender immediately and delete the e-mail without reading it
or making a copy.

Any distribution, copying, or other use of this e-mail by
a person other than the intended recipient is prohibited. Precautions have
been taken to screen this e-mail for viruses but it may not be virus free.
We are not responsible for any damage that may be caused by this
e-mail. This communication is for information purposes only and is not
an offer to sell or a solicitation of an offer to buy any financial product,
an official confirmation of any transaction or an official statement of
Assante. E-mail transmission cannot be guaranteed to be secure or
error-free.
--------------------------------------------------------------------------
MS Sql Server LazyDBA home page