If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > How Do I Combine Several Fields and put a > between each.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-12, 14:45
RBusiness RBusiness is offline
Registered User
 
Join Date: Aug 2010
Posts: 87
SOLVED: How Do I Combine Several Fields and put a > between each.

Hello,

I'm having so much success with the help of people in this forum. It's amazing and I appreciate it so much. I have been learning Access at a rapid pace but with anything there's a curve so I have another 'newbie question'.

I have an empty Field named: category_name

I am trying to merge the data of six other fields into one, separating them with a > and no spaces.

Name of fields to merge

HIERARCHY_LVL_1
HIERARCHY_LVL_2
HIERARCHY_LVL_3
HIERARCHY_LVL_4
HIERARCHY_LVL_5
HIERARCHY_LVL_6

Make believe that each of the HIERARCHY field names above have words in them. Say it's the word representing the number at the end of it. Like if it ends in 1, then the word would be One (in my dB they are sometimes more than one word separated by a comma and space). The result of the merged data would be.

One>Two>Three>Four>Five>Six

I tried a few methods that aren't working. Is an update query not the right tool for this? Any suggestions?

Last edited by RBusiness; 01-30-12 at 16:06. Reason: Solved - noting in title
Reply With Quote
  #2 (permalink)  
Old 01-30-12, 15:19
RBusiness RBusiness is offline
Registered User
 
Join Date: Aug 2010
Posts: 87
I tried a basic query of

category_name: [HIERARCHY_LVL_1]&">"[HIERARCHY_LVL_2]&">"[HIERARCHY_LVL_3]&">"[HIERARCHY_LVL_4]&">"[HIERARCHY_LVL_5]&">"[HIERARCHY_LVL_6]

Access says "The expression you entered contains invalid syntax" "You may have entered an operand without an operator".

That's where I'm at if anyone can chime in!
Reply With Quote
  #3 (permalink)  
Old 01-30-12, 15:24
RBusiness RBusiness is offline
Registered User
 
Join Date: Aug 2010
Posts: 87
Update: I also found that I'm trying to use a character of ">" which is not usually okay to use, so checking around I found that if I wrap it in [] to make [>] it should work, so I tried

category_name: [HIERARCHY_LVL_1]&"[>]"[HIERARCHY_LVL_2]&"[>]"[HIERARCHY_LVL_3]&"[>]"[HIERARCHY_LVL_4]&"[>]"[HIERARCHY_LVL_5]&"[>]"[HIERARCHY_LVL_6]

Still nothing.
Reply With Quote
  #4 (permalink)  
Old 01-30-12, 15:55
RBusiness RBusiness is offline
Registered User
 
Join Date: Aug 2010
Posts: 87
Solved

I was missing the second & symbol following the ">" it works just fine now. Well not perfect but that's another post! I have trailing ">" that don't belong. New post coming!

category_name: [HIERARCHY_LVL_1] & ">"& [HIERARCHY_LVL_2] & ">"& [HIERARCHY_LVL_3] & ">"& [HIERARCHY_LVL_4] & ">"& [HIERARCHY_LVL_5] & ">"& [HIERARCHY_LVL_6]
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On