Hello everyone. Thanks you for your consideration for viewing this question. I'm semi familiar with access and I'm trying to run a cross tab query using an existing database along with an imported excel data table which contains a pricing logic.
The database (Table1) contains the fields... Contract Reference, Transaction #, Transaction Date, NDC codes, Quantity Sold, and Wholesale Price along with other things that are not important to the query.
The imported data table (Table2) contains the fields… Contract Reference, Beginning Date for Price, End Date for Price, NDC codes, Item Description, and Contract Price.
I want to be able to display all the fields mentioned from (Table 1) and then the Contract Price from (Table 2) using some method beyond my current abilities. The problem is I need to use the Transaction Date from (Table 1) and have it select the correct price based on Begin Date and End Date(Table 2).
ContractRef PriceStartDate PriceEndDate NDC Item Description Contract Price ABC11 6/1/2011 9/29/2011 123 Widget 1 10.13 ABC11 9/30/2011 9/30/2011 123 Widget 1 9.74 ABC11 10/1/2011 11/14/2011 123 Widget 1 9.74 ZXY09 1/1/2009 7/31/2009 912 Widget 2 11.65 ZXY09 8/1/2009 12/31/2009 912 Widget 2 11.97 ZXY09 1/1/2010 7/18/2010 912 Widget 2 11.97 ZXY09 8/1/2009 12/31/2009 789 Widget 3 8.97 ZXY09 1/1/2010 7/18/2010 789 Widget 3 9
An example of (Table2) is displayed above. Notice the price changes. I currently am running a query linking only Contract Ref and NDC Codes from the two tables. I want my query to pull the appropriate contract price based upon PriceStartDate and PriceEndDate and display it with table 1. This will hopefully display the correct price for the time period. Can someone please help me improve my method?