473,651 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multivalue field in query


taking the following data:

a w
a n
b r
b y
b p
c a

getting the following result from a query:

a w, n
b r, y, p
c a

without using a function call. (Query returns several thousand rows -
if each one had to execute its own function opening a recordset it
would take unreasonably long to execute... especially since the result
is pulled over MS query into a spreadsheet (via backend on network)...
euch)

possible?

Mar 21 '06 #1
7 3697
"BillCo" <co**********@g mail.com> wrote in message
news:11******** *************@g 10g2000cwb.goog legroups.com...

taking the following data:

a w
a n
b r
b y
b p
c a

getting the following result from a query:

a w, n
b r, y, p
c a

without using a function call. (Query returns several thousand rows -
if each one had to execute its own function opening a recordset it
would take unreasonably long to execute... especially since the result
is pulled over MS query into a spreadsheet (via backend on network)...
euch)

possible?



Converting from one form to the other is time-consuming. Ideally there
would be a way to meet the user requirements without necesarily deciding the
data must be shown in a two-column query. For example, you may be able to
use a report with a multi-column subreport to neatly show a list of all the
related items.

If it really has to be a query, and this is so important and speed is
critical, then you could consider re-designing the database so that it holds
redundant data (shock, horror, break the rules). Provided data is updated
via the front end you provide, you could ensure that whenever the related
table is updated, the main table updates its list of items. Sure MS Access
does not provide triggers which would give you the guarantee that the two
tables remain synchronized, but you could have a pretty good go and include
a checkup routine which would help to build this confidence.

If neither of these options appeal to you, then my final offering is to run
one function which creates one recordset to go through all records and spit
out a summary row for each header, so you create this table locally. I
think I would try this one first and see how long it actually did take
before deciding it will probably be too long. My guess is that even over
the network it would take under 10 seconds.

Mar 21 '06 #2

"BillCo" <co**********@g mail.com> wrote in message
news:11******** *************@g 10g2000cwb.goog legroups.com...

taking the following data:

a w
a n
b r
b y
b p
c a

getting the following result from a query:

a w, n
b r, y, p
c a

without using a function call. (Query returns several thousand rows -
if each one had to execute its own function opening a recordset it
would take unreasonably long to execute... especially since the result
is pulled over MS query into a spreadsheet (via backend on network)...
euch)

possible?


A crosstab query could produce output with each value in it's own column.

a w n
b r y p
c a
Mar 21 '06 #3
I fear you are correct...
-changing output format is a no-go (used for financial reporting. also
the example i gave is a simplification of much more complicated data
arrangement. i'm not screwing with the entire data structure which at
the moment works)
- changing source data structure is also no-go as the info is pulled in
from an external source as a flat file.
- The only option really realistic is a temp table. still not a great
option though, as the result is pulled via external Ms Query query, not
launched from the db application... the temp table would have to be
generated as part of the start of day routine and stored on the back
end. possible, but messy and a pain in the arse for me.

Mar 21 '06 #4
one of us is mistaken about how to use a crosstab query!
if you post the sql for how this would actually work, i'll eat my
hat!!! i'm actually not wearing a hat - but i will gladly use your
query structure and thank you perfusely

Mar 21 '06 #5
"BillCo" <co**********@g mail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
I fear you are correct...
-changing output format is a no-go (used for financial reporting. also
the example i gave is a simplification of much more complicated data
arrangement. i'm not screwing with the entire data structure which at
the moment works)
- changing source data structure is also no-go as the info is pulled in
from an external source as a flat file.
- The only option really realistic is a temp table. still not a great
option though, as the result is pulled via external Ms Query query, not
launched from the db application... the temp table would have to be
generated as part of the start of day routine and stored on the back
end. possible, but messy and a pain in the arse for me.

Whatever you can do with MS Query, surely you can do with your own vba
coding? I would certainly see what the quickest function I could write to
create that temp table.
I understand (and had expected) that your actual data structure is more
complex, but still, the temp table only needs to have the two columns. I
could imagine providing a way for users to refresh at will, or auto-refresh
when some report is run.
Mar 21 '06 #6

"BillCo" <co**********@g mail.com> wrote in message
news:11******** *************@g 10g2000cwb.goog legroups.com...
one of us is mistaken about how to use a crosstab query!
if you post the sql for how this would actually work, i'll eat my
hat!!! i'm actually not wearing a hat - but i will gladly use your
query structure and thank you perfusely


TRANSFORM First(TEST.T2) AS [The Value]
SELECT TEST.T1
FROM TEST
GROUP BY TEST.T1
PIVOT TEST.T0;

T1 is your 1st column
T2 is your 2nd column
T0 is a numeric to count output column

1 a w
2 a n
1 b r
2 b y
3 b p
1 c a

You need 3 columns for a cross tab, T0 could be auto number, but you would
get more output columns
Mar 21 '06 #7
there's code at AccessWeb that does this fConcatChild.
www.mvps.org/access and then look under the modules section (I think).

Mar 21 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6194
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
11
1911
by: Rolf Barbakken | last post by:
I have an xml with records like this one: <a:response> <a:href>http://server/public/sol/comp/1049306.eml</a:href> <a:propstat> <a:status>HTTP/1.1 200 OK</a:status> <a:prop> <d:customerid>1049306</d:customerid> <e:professioncode b:dt="mv.string"> <c:v>byggtapetserarbeider</c:v>
3
53753
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have a specific need to only add a new field to a table if possible. Here's a simplified example of what I'm trying to do: I get a file with the following two fields: First Name
26
2954
by: temp | last post by:
Hi, My boss is asking me to generate a column mapping report of all the queries. Basically, we get our data from ORACLE. There's a queary that create new table from ORACLE tables. Then, there are reports and queries that uses the new table. Is there an add in or tool that can generate mapping reports of the queries.
1
1668
by: Joel Barsotti | last post by:
In asp3, you could set a multivalue cookie by doing something like this Response.Cookies("login")("user") = Session('user'); Response.Cookies("login")("password") = Session('password'); Response.Cookies("login")("version") = Application('cookieVersion'); I can't seem to find a way to do anything similiar with the HttpCookie object, is there something that I'm missing or do I need to manage a cookie for each value I want to set these...
1
4116
by: Ben | last post by:
NooB: Anyone help with what I could be doing incorrectly here? Trying to have a parameter drop down list where a user can select one or more of the available values contained in the table to filter out results. Have a single table with five values. Keep getting the following error.... Table name is Name Field is NickName Parameter name is "Nick", datatype string, prompt "Select NickNames",
1
1657
by: jacklainer | last post by:
Hello, I have a table with more than 10 million records in. There's one varchar2 attribute holding comma delimited values. so one column could look like: "ED57667,868D866,R4124141,JH231311" What are the options to make queries for this attribute fast? If I do a search "like %R4124141%" the query is very slow. What kind of index should I use? thanks for your help marco
5
1751
by: varshaP | last post by:
Hi.. How to remove selected value from a readonly multivalue field, on clicking the button ?
1
2037
by: beemomo | last post by:
Hi everyone there, i am facing the problem with using the SQL condition --LIKE in a multi value field of my access 07 table. I have a multi value field which store a number of keywords for a particular document, named as Keywords. I need to find out which document contains a particular keyword, for example: i want to know all the documents which contain a keyword of "Ventilation". My SQL statements sound like this: SELECT ID,...
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.