Link to home
Start Free TrialLog in
Avatar of Andy Donnelly
Andy DonnellyFlag for United States of America

asked on

Concatenating a numeric field with a varchar field

I am trying to concatenate a numeric field with a varchar field in a view.  If I use the & sign or the + sign I get an error.  Is there a way to concatenate them or change the number field to a text field?

Thanks,

Andy
Avatar of MikeWalsh
MikeWalsh
Flag of United States of America image

select convert(varchar(50), 1) + 'hi'
so SELECT convert(varchar(50), YourIntColumn) + YourVarcharColumn will give you what you are looking for. It should anyway.
ASKER CERTIFIED SOLUTION
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good point with the coalesce, lowfat.. My mind nulled out the possibility of null.