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

Adding two columns?

Status
Not open for further replies.
Apr 6, 2004
33
US
Hello,
I'm sure this can be done but I can't seem to figure it out. In a table I have a field called job and another called subjob. I want to add them together to get one field but also I want to put a "-" between the job and subjob. It should look like this 100356-125. I am using vb.net if this matters or not. I want to take the result set and export to an excel doc.

Thanks
Tim
 
If they are numeric fields you need to convert the datatype before you can join the fields into a single field..

i.e. select cast(job as varchar(300)) + '-' + cast(subjob as varchar(300) from sometable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top