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!

field merge

Status
Not open for further replies.

Regelos

Programmer
Nov 16, 2005
35
US
I have a field that has a long string (52) collum delimited items in it and I'm trying to build a forcasting report but the problem I have is when it runs into the next year I'm having trouble retrieving it so I am wondering if there is a way to merge the fields together

IE there are to lines 2007 (52) and 2008 (52) I would like to setup 20072008
 
Um...I don't understand what you're wanting? Do you have to columns, 2007 & 2008, and you want to combine both columns?

Code:
select [2007]+[2008] from mytable

Are you wanting to update your table with a third column that combines the two columns?

Code:
ALTER TABLE mytable ADD [20072008] VARCHAR(104) NULL
update mytable set [20072008]=[2007]+[2008]
 
Your sentence structure is stuff of legends Regelos.

If you are just trying to concatenate 2 char columns
with no spaces, do this:

Code:
Select rtrim(col1) + rtrim(col2) as addedStrings


[monkey][snake] <.
 
I will try your suggestions but let me clear up what I am talking about

I have multiple columns I want to key off the part # collum (wich I already have but then I have this quote column data is generally like this

Part# can have multiple quote years 2006,2007,2008 etc.. All I care about is the 2007-2008. then there is this quote column that has this long 52 char string in it that is dif from 2007-2008 wich is what I wanted to tag to the end.

so "part 1" "2007" "1,2,3,etc"
"2008" "1,2,3,etc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top