473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 12483
NeoPa
32,556 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
NeoPa
32,556 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

Thanks!
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
NeoPa
32,556 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
NeoPa
32,556 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

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

Similar topics

1
by: TheOne | last post by:
I have two classes: class OntologyParser { ... protected: virtual void startElement(void *userData, const char *name, const char **atts); virtual void endElement(void *userData, const char...
2
by: enio | last post by:
Hi, I intend to get some answer from postgres concerning if an update command has altered some records in the database. To do this I coded this function: create or replace function...
0
by: Crystal | last post by:
I have created a small program that prints out an organization chart in PHP using the GD lib's imagecreate, imageline and imagestring functions. Basically, a user selects an employee from a...
4
by: B. Williams | last post by:
I have written this program for an assignment that requires a static member function to set a static data member, but I can't figure out how to get it to change the value once set. Would someone...
6
by: mforema | last post by:
Hi Everybody, I have a function that worked perfectly when it was used in a query. I received help in creating this function from this discussion: Help with Query and Subform - post #18 ...
8
by: cpptutor2000 | last post by:
Could some C guru please help me? I have a function that takes as an argument a pointer to an array of unsigned chars (basically a hex representation of a dotted decimal IP address). When I print...
4
jenkinsloveschicken
by: jenkinsloveschicken | last post by:
I imagine this is a n00b mistake, but the problem I am having is that the first function(stratQual) is evaluating to "No" despite the argument being passed to it being greater than 80.00. The second...
3
by: viki1967 | last post by:
Hi there. I have a problem with function updateSum(id). The code is this: <script language="javascript" type="text/javascript"> <!--
4
by: StephQ | last post by:
I need to know if it is possible to solve the following problem (I am really stuck at it). Consider the CRTP pattern: struct Derived { ....// May contain void operate( double x ) , may not....
2
by: presencia | last post by:
Hi everyone, I have written a small program running fine until a Segmentation fault. Using a debugger I have localized the function the fault happens in. The Signal appears during a call to delete...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.