473,405 Members | 2,373 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,405 software developers and data experts.

Info from multiple record in one query field?

Quick Example to explain requirements:

Default query behaviour
Expand|Select|Wrap|Line Numbers
  1. Order              Item
  2. 12345             <tr><td>Manuf0 Model0 Type0</td><td>Description0</td></tr>
  3. 12345             <tr><td>Manuf1 Model1 Type1</td><td>Description1</td></tr>
  4. 12346             <tr><td>Manuf0 Model0 Type0</td><td>Description0</td></tr>
Query behavior I want (but doubt is possible)
Expand|Select|Wrap|Line Numbers
  1. Order              Item
  2. 12345             <tr><td>Manuf0 Model0 Type0</td><td>Description0</td></tr><tr><td>Manuf1 Model1 Type1</td><td>Description1</td></tr>
  3. 12346             <tr><td>Manuf0 Model0 Type0</td><td>Description0</td>
The table tags are for an external program (and to make things easier for me) and are created on the fly by the query.

There are 3 tables at work there;
Invoice - OrderNo(pk)
Order - OrderNo(fk) & ProdID(fk)
Product - ProdID(pk) & manuf & model & type & description

As a start, is this even possible with queries? It has to be done automatically, no user interaction necessary.

Thanks
Mandi
Jan 20 '09 #1
5 1308
Stewart Ross
2,545 Expert Mod 2GB
Hi mandi. You would need to use some form of bespoke coded solution for this, as queries cannot selectively pivot columns the way you describe. The closest built-in facility is the crosstab query, but these would not achieve the effect you require (as crosstabs in Access pivot single column values across a set of headings drawn from all heading values in the whole dataset).

As you are dealing with real-world order data I am assuming that the many-side product lines for any one order number are truly multiple and potentially unlimited (even if there is some form of practical limitation on the size of an order), not just the simple example of two entries for one reference you show.

On the bright side if you develop a bespoke code solution it can certainly be run on an entirely automated basis.

-Stewart
Jan 20 '09 #2
@FishVal
Exactly what I want to do that, thanks!
But I'm getting the reserved error. I think it's possibly because not all of our orders have multiple items on them. I'm going to see if I can include an IIf to fix that.

Thanks FishVal
Jan 21 '09 #4
Aha!
It was nothing to do with what I thought. I changed the 'Max' to 'Last' and it works brilliantly.

Thanks again =)
Jan 21 '09 #5
NeoPa
32,556 Expert Mod 16PB
Hi Mandi.

Last() should work equally well, but I can't imagine a scenario where Max() wouldn't work too :S

Any string value, compared with another string value, which is the same as the first except in that it has extra characters at the end, must surely be less than the second value. Hence the Last() one must also be the Max().
Jan 28 '09 #6

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

Similar topics

6
by: Paul | last post by:
In real life situation, do we ever come across a situation where we would need two base objects in an object. A snippet is worth 1000 words (: so... class Base { }; class Derived1:public Base...
1
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
3
by: Steven Stewart | last post by:
Hi there, I have posted about this before, but yet to arrive at a solution. I am going to try to explain this better. I have an Employees table and a Datarecords table (one-to-many...
3
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main,...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
5
by: Beacher | last post by:
I've noticed that you can only have a sub datasheet pointing to one table... is there anyway to change this? for example I have Customer | ---------- Customer/Product | -----------...
6
by: ApexData | last post by:
I have 2 tables: Table1 and Table2. Neither one has a primary key because each table will only have 1-record. My form is a SingleForm unbound with tabs (my desire here). Using this form, in...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: assgar | last post by:
Hi I was using a schroll bar to display multiple rows of dynamically created from database records. The scrolling was not displaying the data properly so I have decided to use pagination. The...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.