469,271 Members | 852 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Problem with ConcatRelated() Function

Hi, I'm very rusty at this, been awhile. I have a table that looks like this:

Expand|Select|Wrap|Line Numbers
  1. Angell     10
  2. Angell     70
  3. Angell     96
  4. Cook       12
  5. Cook       15
  6. Cook       22
  7. Cook       25
I am using Allen Browne's ConcatRelated macro to get this:

Expand|Select|Wrap|Line Numbers
  1. Angell     10, 70, 96
  2. Cook       12, 15, 22, 25
My query command is as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT associate, ConcatRelated("[catagory]","[Categories not found]","[associate]="" & [associate] & """)
  2. FROM [Categories not found];
I am getting "error 3061 - Too few parameters, expecting 1"

Can anyone help? Thanks!
Sep 6 '11 #1
11 12010
32,171 Expert Mod 16PB
I'm not familiar with Allen Browne's function, but we have one here at Combining Rows-Opposite of Union.

That said, your SQL code seems to indicate trouble working with and properly using quotes (See Quotes (') and Double-Quotes (") - Where and When to use them), as well as the spelling of category in one instance (which may simply reflect the failure of the db designer of course so be careful as I've changed it to the correct spelling of the word with just the one 'a').

Try :

Expand|Select|Wrap|Line Numbers
  1. SELECT [Associate]
  2.      , ConcatRelated('[Category]','[Categories not found]','[Associate]=''' & Me.Associate & '''')
  3. FROM   [Categories not found]
Sep 6 '11 #2
Thanks, NeoPa, it worked!
Sep 7 '11 #3
32,171 Expert Mod 16PB
You're welcome Michelle :-)
Sep 7 '11 #4
Could you possibly help me to get only one record per associate? Right now I get as many as there were catagories, for ex:

Angell 10,70,96
Angell 10,70,96
Angell 10,70,96

Sep 7 '11 #5
Within the same query, I mean, I know I can do it in a separate query. I have several already, and am trying to simplify...
Sep 7 '11 #6
Just found "unique values parameter" in query properties, going to try that...
Sep 7 '11 #7
Got it! Things are moving along...
Sep 7 '11 #8
32,171 Expert Mod 16PB
I would expect you to need the GROUP BY clause in your SQL. That doesn't correspond to the unique values setting :-S
Sep 7 '11 #9
Thanks, Neo, that's exactly what I did, after some internet research :-)
Sep 8 '11 #10
32,171 Expert Mod 16PB
That's good then Michelle. I can't help smiling wryly though, as that was all included in the link I posted in post #2. Never mind, the extra searching probably exposed you to a bunch of new ideas anyway, which always proves beneficial ;-)
Sep 8 '11 #11
I never opened the link, I have to admit. The environment here is very high-pressure and I'm always trying to move as quickly as possible.
Sep 8 '11 #12

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by TheOne | last post: by
4 posts views Thread by B. Williams | last post: by
8 posts views Thread by cpptutor2000 | last post: by
4 posts views Thread by StephQ | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.