Use the cast or convert function to change the data types

SELECT smart_address.company + '(' +  cast(smart_address.add_id as
nvarchar(20)) + ')' AS company1, smart_address.*




-----Original Message-----
From: NUGROHO NOTO [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 08, 2007 10:36 AM
To: SQL
Subject: Re: How to Combine 2 column into alias.

> I have a Select statement.. which works in access. 
> SELECT smart_address.company + '(' +  smart_address.add_id + ')' AS 
> company1, smart_address.*

turns out... those 2 column is different data type. 
one is Nvarchar, and other is int

in Access I can combine no problem. 
how can I combine in SQL ?




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2980
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6

Reply via email to