473,379 Members | 1,377 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,379 software developers and data experts.

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 3671
"BillCo" <co**********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.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**********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.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**********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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**********@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.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
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...
11
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>...
3
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...
26
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...
1
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');...
1
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...
1
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" ...
5
by: varshaP | last post by:
Hi.. How to remove selected value from a readonly multivalue field, on clicking the button ?
1
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...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.