Thanks for your reply, here is how the data is stored:
Table 1
Part number | Requisition Number | Order Qty | Place Date
12345 10000 10 10/5/2007
12345 10001 15 11/30/2007
67891 10002 100 10/5/2007
67891 10003 150 12/10/2007
Table 2
Part number | PO # and Line # | Vendor # | Unit Cost | | Date
12345 900 Ln # 1 01 $ 1.00 8/1/07
12345 900 Ln # 2 01 $ 1.00 7/1/07
12345 875 Ln # 2 01 $ 1.00 5/5/07
12345 750 Ln # 1 02 $ 1.17 12/5/06
67891 920 03 $ 2.00 8/10/07
67891 850 03 $ 2.00 4/9/07
67891 725 04 $ 2.75 1/10/07
Table 3
Vendor Number | Vendor Name
01 ACME Supply
02 Electronic Dist.
03 Aero Machine
04 #1 Machine
I want to associate the latest data from Table 2 (Last PO for That Part # and last paid price) along with Vendor Name from Table 3 to each record in table 1.
Currently My report will output each record in table 1 duplicated for every record in table 2 joining on the Primary key: (Part number) an example of the outpt is:
12345 10000 10 10/5/2007 ACME Supply $ 1.00
12345 10001 15 11/30/2007 ACME Supply $ 1.00
12345 10000 10 10/5/2007 ACME Supply $ 1.00
12345 10001 15 11/30/2007 ACME Supply $ 1.00
12345 10000 10 10/5/2007 ACME Supply $ 1.00
12345 10001 15 11/30/2007 ACME Supply $ 1.00
12345 10000 10 10/5/2007 Electronic Dist. $ 1.17
12345 10001 15 11/30/2007 Electronic Dist. $ 1.17
I understand how I get these results (Primary Key = Part Number) what I can't figure out is how to select only the latest record for each part,
I have tried Maximum formulas for group selection in a Stand alone report against Table 2 only:
{poa.poa_stsdte}= Maximum ({poa.poa_stsdte},{pos.pos_itemno} ) and
{pos.pos_orderno}=Maximum ({pos.pos_orderno},{pos.pos_itemno} )and
{pos.pos_lnno}=Maximum ({pos.pos_lnno},{pos.pos_itemno} )
that works I get one record for each Part, I dont Know how to Tie this logic into the Associative report with Purchase reqs. this is the result I need:
P/N | Req # | Order Qty | Place Date | Vendor | Price
12345 10000 10 10/5/2007 ACME $1.00
12345 10001 15 11/30/2007 ACME $1.00
67891 10002 100 10/5/2007 Aero Mach $ 2.00
67891 10003 150 12/10/2007 Aero Mach $ 2.00