• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

SQL Server query combining fields into single field

I have recently changed over to SQL Server after using a MS Access database in my ASP pages.  I had a query in which I combined 2 field values into a single value for use in my pages.  When I changed over the SQL Server, however, the query doesn't work.  Below is the query as I wrote it for MS Access.  Is it possible to write this to work in SQL Server 2005?  And if so, what do I need to fix?

Chris Cote
SELECT dbo.tblClass.classID AS ID, [type] & ' ' & [class] AS Expr1 FROM dbo.tblClass ORDER BY [type] & ' ' & [class];

Open in new window

0
chrscote
Asked:
chrscote
1 Solution
 
_DanElliottCommented:
Try changing the & to +
 SELECT dbo.tblClass.classID AS ID, [type] + ' ' + [class] AS Expr1 FROM dbo.tblClass ORDER BY [type] + ' ' + [class]; 

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now