|
From: t8ntboy on 2 Apr 2008 09:44 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 2 Apr 2008 10:06 SELECT CAST(Term AS VARCHAR(10)) + CAST(CRN AS VARCHAR(10)) AS Comb FROM dbo.SAS
From: Plamen Ratchev on 2 Apr 2008 10:22 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
|
Pages: 1 Prev: XML vs. Relational Data Next: [IAT ELEZIONI] Presentazione candidati |