I have a table that shows the net cost and selling cost depending on the weight. The Slab of the rates are from Min, -45, +45, 100, 300, 500, 1000, Pivot
I created 8 queries to filter a different Slab of the table for example the query of Min is as below
Then to be able to show the slab in different columns I created a query that depends on this other 8 queries as below
I have being trying to replace the 8 queries in this Main Query, but I cannot make it happen.
Can someone advise me how to do it.
I created 8 queries to filter a different Slab of the table for example the query of Min is as below
Code:
RateAirlineSlabTable.RateAirlineid, RateAirlineSlabTable.RateSlab, RateAirlineSlabTable.NetRate, RateAirlineSlabTable.SellingRate FROM RateAirlineSlabTable WHERE (((RateAirlineSlabTable.RateSlab)="Min"));
Then to be able to show the slab in different columns I created a query that depends on this other 8 queries as below
Code:
SELECT RateAirlineTable.RateAirlineID, RateMinQuery.NetRate AS MinNR, RateMinQuery.SellingRate AS MinSR, [Rate-45Query].NetRate AS [-45NR], [Rate-45Query].SellingRate AS [-45SR], [Rate+45Query].NetRate AS [+45NR], [Rate+45Query].SellingRate AS [+45SR], [Rate+100Query].NetRate AS [+100NR], [Rate+100Query].SellingRate AS [+100SR], [Rate+300Query].NetRate AS [+300], [Rate+300Query].SellingRate AS [+300SR], [Rate+500Query].NetRate AS [+500NR], [Rate+500Query].SellingRate AS [+500SR], [Rate+1000Query].NetRate AS [+1000NR], [Rate+1000Query].SellingRate AS [+1000SR], RatePivotQuery.RateSlab AS [Pivot], RatePivotQuery.NetRate AS PivotNR, RatePivotQuery.SellingRate AS PivotSR FROM RatePivotQuery RIGHT JOIN ([Rate+1000Query] RIGHT JOIN ([Rate+500Query] RIGHT JOIN ([Rate+300Query] RIGHT JOIN ([Rate+100Query] RIGHT JOIN ([Rate+45Query] RIGHT JOIN ([Rate-45Query] RIGHT JOIN (RateMinQuery RIGHT JOIN RateAirlineTable ON RateMinQuery.RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate-45Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate+45Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate+100Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate+300Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate+500Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON [Rate+1000Query].RateAirlineid = RateAirlineTable.RateAirlineID) ON RatePivotQuery.RateAirlineid = RateAirlineTable.RateAirlineID;
I have being trying to replace the 8 queries in this Main Query, but I cannot make it happen.
Can someone advise me how to do it.