Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Rename New Column and combine fields in Table

Author  Topic 

JimAmigo
Posting Yak Master

119 Posts

Posted - 2004-07-13 : 13:26:11
I have a make table query in access I am converting to SQL and testing in Query Analyzer.

Basically in Access I am creating a new field in the table results by combining a couple of fields in my tables in the query.

Example in MS Access SQL: [tbl_RealtiveFrockedRank].[ActualRank] & " " & [tbl_OFFICER].[FirstName] & " " & [tbl_OFFICER].[LastName] AS Name

End result for one result in field would be "President John Kennedy", where in database there are three fields, [tbl_RealtiveFrockedRank].[ActualRank] = President, [tbl_OFFICER].[FirstName] = John, [tbl_OFFICER].[LastName] = Kennedy.

But in my results table I want to combine all three into a single field NAME.

I tried using the above but kept getting error.

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-13 : 13:34:15
FOR sql server instead of & " " & use + ' ' +


Duane.
Go to Top of Page

JimAmigo
Posting Yak Master

119 Posts

Posted - 2004-07-13 : 13:41:34
That solved the issue. Thank you so much Duane!

It's these little differneces that converting things to newer technology a pain in the butt. LOL We put in the requisition for SQL Sever over 2 years ago got it a couple of months ago and now the company won't give us any training. Then they wonder why it takes so long to get the new systems online.

Sorry to vent and thanks again!
Go to Top of Page
   

- Advertisement -