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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating columns 1

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
0
0
US
Hello, I am creating a report off the database and I need to pull a couple of fields from a table but I need the output to come back in one field. Example:
Table:
field1 field2 field3

I need the output to be like
field1, field1 some text field 2

so basically return field 1 and 2 as one result plus some text in there. Field 2 is Saturday hours and Field3 is Sunday hours, so the output needs to be like
Saturday: 8-6 Sunday: 9-4

What is the syntax for that

thanks!!!
 
SELECT ('Saturday ' + field1 + 'sunday ' + field2) as newvalue FROM table
 
Thanks. Another quick question about SQL. Can SQL or T-SQL handle searching for files on a network? I am guessing not, but just wated to be sure.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top