From: t8ntboy on
Here's what I have:

SELECT (Term + CRN) AS Comb
FROM dbo.SAS

Both Term and CRN are Int fields.

When it concatenates it is adding the values together.

For example:

Term CRN Comb
5 18 23
6 11 17


What I want is:

Term CRN Comb
5 18 518
6 11 611


How can this be done?

Thanks
From: Mark on
SELECT CAST(Term AS VARCHAR(10)) + CAST(CRN AS VARCHAR(10)) AS Comb
FROM dbo.SAS
From: Plamen Ratchev on
If the values for the CRN column do not exceed 100, then you can do:

SELECT Term * 100 + CRN AS Comb
FROM dbo.SAS

Otherwise Mark's suggestion to concatenate as strings will work.

HTH,

Plamen Ratchev
http://www.SQLStudio.com