1ExcelNovice
New Member
- Joined
- Aug 24, 2012
- Messages
- 24
Hello Access Pro's,
I have a query that uses a table linked to an excel file named Shipment Report. The format of the excel file is a little funky. I'm trying to match the Static Route (i.e., 8147_B01) with the Static Route Total(s) row associated with that route and return the Cost, Fuel Cost, Total Cost, Average Cost, and Stop Count (please see last example below). I'm still fairly new to Access and still have a lot to learn. Thank you for your help in advance!
[TABLE="width: 568"]
<COLGROUP><COL style="WIDTH: 71pt" span=8 width=95><TBODY>[TR]
[TD="class: xl64, width: 95, bgcolor: silver"]Static Route[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Delivery End Date[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]TC Shipment ID[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Fuel Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Total Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Average Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Stop Count[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"]8147_B01[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/09/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02117328[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/10/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02121198[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/11/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02125080[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/12/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02128891[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/13/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02132817[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]Static Route Total[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]1,365.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]61.45[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]1,426.45[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]5[/TD]
[/TR]
</TBODY>[/TABLE]
I'd love for my query to return this information:
[TABLE="width: 557"]
<TBODY>[TR]
[TD="align: center"]Static Route[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Cost</SPAN>[/TD]
[TD="align: center"]Fuel Cost</SPAN>[/TD]
[TD="align: center"]Total Cost</SPAN>[/TD]
[TD="align: center"]Average Cost</SPAN>[/TD]
[TD="align: center"]Stop Count</SPAN>[/TD]
[/TR]
[TR]
[TD="align: center"]8147_B01</SPAN>[/TD]
[TD="align: center"]Static Route Total</SPAN>[/TD]
[TD="align: center"]1,365.00</SPAN>[/TD]
[TD="align: center"]61.45</SPAN>[/TD]
[TD="align: center"]1,426.45</SPAN>[/TD]
[TD="align: center"]285.29</SPAN>[/TD]
[TD="align: center"]5</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL><COL><COL><COL></COLGROUP>[/TABLE]
</SPAN>
I have a query that uses a table linked to an excel file named Shipment Report. The format of the excel file is a little funky. I'm trying to match the Static Route (i.e., 8147_B01) with the Static Route Total(s) row associated with that route and return the Cost, Fuel Cost, Total Cost, Average Cost, and Stop Count (please see last example below). I'm still fairly new to Access and still have a lot to learn. Thank you for your help in advance!

[TABLE="width: 568"]
<COLGROUP><COL style="WIDTH: 71pt" span=8 width=95><TBODY>[TR]
[TD="class: xl64, width: 95, bgcolor: silver"]Static Route[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Delivery End Date[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]TC Shipment ID[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Fuel Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Total Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Average Cost[/TD]
[TD="class: xl64, width: 95, bgcolor: silver"]Stop Count[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"]8147_B01[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/09/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02117328[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/10/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02121198[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/11/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02125080[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/12/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02128891[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]09/13/2013[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]CS02132817[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]273.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]12.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"]Static Route Total[/TD]
[TD="class: xl65, width: 95, bgcolor: transparent"] [/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]1,365.00[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]61.45[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]1,426.45[/TD]
[TD="class: xl66, width: 95, bgcolor: transparent"]285.29[/TD]
[TD="class: xl67, width: 95, bgcolor: transparent"]5[/TD]
[/TR]
</TBODY>[/TABLE]
I'd love for my query to return this information:
[TABLE="width: 557"]
<TBODY>[TR]
[TD="align: center"]Static Route[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Cost</SPAN>[/TD]
[TD="align: center"]Fuel Cost</SPAN>[/TD]
[TD="align: center"]Total Cost</SPAN>[/TD]
[TD="align: center"]Average Cost</SPAN>[/TD]
[TD="align: center"]Stop Count</SPAN>[/TD]
[/TR]
[TR]
[TD="align: center"]8147_B01</SPAN>[/TD]
[TD="align: center"]Static Route Total</SPAN>[/TD]
[TD="align: center"]1,365.00</SPAN>[/TD]
[TD="align: center"]61.45</SPAN>[/TD]
[TD="align: center"]1,426.45</SPAN>[/TD]
[TD="align: center"]285.29</SPAN>[/TD]
[TD="align: center"]5</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL><COL><COL><COL></COLGROUP>[/TABLE]
</SPAN>