I'm having trouble running this query. Someone suggested that I break down the query into two parts but I have no idea how to do this. I'm hoping anyone can help shed some light.
(IIf([qty] = "MAX" AND Net >= [Rate]),[Rate], Net) As Net2
This query works without the bold lettering but when adding the bold leterring, I get a circular reference. Is there a way around this?
Thanks in advance.
Code:
SELECT DISTINCTROW
tblRatesHeader.Quote,
tblRatesHeader.Origin,
tblRatesHeader.Destination,
tblRatesHeader.Mode,
tblRateDetail.Rate,
tblRateDetail.Weight,
tblRateDetail.WgtBrk,
tblRateDetail.Qty,
IIf([qty]="MC"
Or [RateType]="FLAT"
Or [qty]="1"
Or [qty]="2"
Or [qty]="3",
[RATE],
(IIf([txtWeight]<=[Weight],[Weight]*[Rate],[txtWeight]*[Rate]))) AS Net,
(IIf([qty] = "MAX" AND Net >= [Rate]),[Rate], Net) As Net2
Code:
FROM tblRatesHeader INNER JOIN tblRateDetail ON tblRatesHeader.Quote = tblRateDetail.Quote;
FROM tblRatesHeader
INNER JOIN tblRateDetail ON tblRatesHeader.Quote = tblRateDetail.Quote;
This query works without the bold lettering but when adding the bold leterring, I get a circular reference. Is there a way around this?
Thanks in advance.