Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL - combine results of 2 fields to 1. 2

Status
Not open for further replies.
Jan 23, 2003
26
US
Hi,
I'm trying to create a select statement to combine the results of 2 fields into 1.

For example,
I have 2 fields: First Name, Last Name. I'd like to combine so my results to show First Name Last Name in the same field.

Field 1 Field 2
Jane Smart
Results: Jane Smart.

How should the SQL statement look?
 
Hi,

Try this SQL

Select firstname + ' ' + Lastname FullName from Tbl

Sunil
 
Thanks so much for responding so quickly! Yes that worked for the names.
How would I modify the select statement to make it work with numbers, but I don't want to add up the 2 numbers in each field.
For example:
Field 1 Field 2
15 20
I'd like the results to show:
15.20

This would mean I need to add a . between the 2 fields.

Thanks again for your help!
 
select cast(field1 as varchar) + '.' +
cast(field2 as varchar) from t
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top