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

Stock Code Relation to Many Purchase Orders

I have been trying and looking for a few days to a solution into a
query

I am looking up one stock code from a table containing multiple
outstanding purchase orders for that one item.

The problem comes in that I'd like to display all those PO numbers in
one cell.

Example:

StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546
Can anyone help ... or lead me in a direction?

May 2 '07 #1
5 1819
So right now you're returning:

StockCode, [Purchase Orders]
0123456789, 45-1234
0123456789, 46-4567
0123456789, 47-4546

So you need:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Generic%20Function%2 0To%20Concatenate%20Child%20Records'

Cheers,
Jason Lepack

On May 2, 4:22 pm, walt...@gmail.com wrote:
I have been trying and looking for a few days to a solution into a
query

I am looking up one stock code from a table containing multiple
outstanding purchase orders for that one item.

The problem comes in that I'd like to display all those PO numbers in
one cell.

Example:

StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546

Can anyone help ... or lead me in a direction?

May 2 '07 #2
If your system is normalized (and it sounds like it might be - has a
one-to-many query) then the actual data would look like this for each
stock order in the Detail Data table

StockCode Purchase Orders
0123456789 45-1234
0123456789 46-4567
0123456789 47-4546

In order to get it into this form

StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546

you need to use a Crosstab query - which would actually make it look
like this:

StockCode Order1 Order2 Order3
0123456789 45-1234 46-4567 47-4546

You can read about crosstab queries in Access help.


Rich

*** Sent via Developersdex http://www.developersdex.com ***
May 3 '07 #3
On May 2, 6:56 pm, Rich P <rpng...@aol.comwrote:
If your system is normalized (and it sounds like it might be - has a
one-to-many query) then the actual data would look like this for each
stock order in the Detail Data table

StockCode Purchase Orders
0123456789 45-1234
0123456789 46-4567
0123456789 47-4546

In order to get it into this form

StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546

you need to use a Crosstab query - which would actually make it look
like this:

StockCode Order1 Order2 Order3
0123456789 45-1234 46-4567 47-4546

You can read about crosstab queries in Access help.

Rich

*** Sent via Developersdexhttp://www.developersdex.com***
Well yes ... and normally that would probably be ok .... except for
the fact that there are 100's of PO's ... and that will exceed the
column limit, I'm sure.
Perhaps I can rewrite my other query's to request only one record at a
time instead of running a crosstab for all of them at the same time.

May 3 '07 #4
On May 2, 3:22 pm, walt...@gmail.com wrote:
I have been trying and looking for a few days to a solution into a
query

I am looking up one stock code from a table containing multiple
outstanding purchase orders for that one item.

The problem comes in that I'd like to display all those PO numbers in
one cell.

Example:

StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546

Can anyone help ... or lead me in a direction?
That worked fantastic!!
Thanks

May 3 '07 #5
Glad to hear it! But what worked?

Cheers,
Jason Lepack

On May 3, 11:35 am, walt...@gmail.com wrote:
On May 2, 3:22 pm, walt...@gmail.com wrote:
I have been trying and looking for a few days to a solution into a
query
I am looking up one stock code from a table containing multiple
outstanding purchase orders for that one item.
The problem comes in that I'd like to display all those PO numbers in
one cell.
Example:
StockCode Purchase Orders
0123456789 45-1234, 46-4567, 47-4546
Can anyone help ... or lead me in a direction?

That worked fantastic!!
Thanks

May 3 '07 #6

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

Similar topics

3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
7
by: simon | last post by:
Hi I know this has been done to death....but obviously at some point in the dim and distant past! I wish to program a retail database for my shop, I have trawled many forums and I only manage...
3
by: Merlin | last post by:
Hi Group Anybody know where I could find a Example of a simple stock control system? Many Thanks Merlin
1
by: Ingrid | last post by:
To help explain my question, I have illustrated the table relationships and listed the fields in each table. Usually the Order Details table has the most records in a database due to one to many...
4
by: peter | last post by:
In the sample northwind database when an order is sent the sent value come of the instock value. I can not work out how they have done this . I can see that it is an eventprocedure but can not...
2
by: Hank | last post by:
Hello, Does anyone have a formula for calculating the number of days a stock was owned? Of course its real easy if you buy 100 shares on April 1 and sell 100 shares on July 1 but what about...
1
by: dan | last post by:
Hi I am trying to create a database for a shop with a barcode reader the problem I have is more than likely a simple one but cant get my head around it. the question is how do I create a form...
2
by: etep | last post by:
In my effort to create an order management database, I have established a one to many relation between my tables orders and order details. Tables: Orders: Customer, shipping method, etc. ...
40
by: sazd1 | last post by:
Hi Student2 I am working on similar kind of thing for stock calculation but could not find any solution to my problem even after putting my problem to different forums. I saw your post that you...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.