S
sccofer
I have two tables Returns and ReturnDetails, I want to receive back
from a query all records from Returns and only records from
ReturnDetails that = specific date. The below query almost works, the
problem I am having is when there is a record in ReturnDetails with a
date different than the criteria date, in this case 3/1/2006, the
record is not showing up in the results. Obviously this is becuase
Rtn_Detail.Month_Processed <> 3/1/2006 and it also isn't equal to null.
I want ALL records from the Returns table the meet the FREQ criteria
every time and cant get my head around a solution. I think I have been
looking at it to long as it doesnt seem like it should be that
difficult. Thanks in advance for any pointers...
SELECT [T RETURNS].RTN, [T RETURNS].ST, [T RETURNS].ENTITY, [T
RETURNS].[RTN TYPE], [T RETURNS].PREP, [T RETURNS].FREQ,
Rtn_Detail.Month_Processed, Rtn_Detail.Amount_Paid,
Rtn_Detail.Date_Delivered, Rtn_Detail.Review_Date, Rtn_Detail.Notes,
Rtn_Detail.Discount_Taken
FROM [T RETURNS] LEFT JOIN Rtn_Detail ON [T RETURNS].RTN =
Rtn_Detail.[RTN Number]
WHERE
((([T RETURNS].FREQ)=1 Or ([T RETURNS].FREQ)=7 Or ([T RETURNS].FREQ)=11
Or ([T RETURNS].FREQ)=15 Or ([T RETURNS].FREQ)=14) AND
((Rtn_Detail.Month_Processed)=#3/1/2006#))
OR ((([T RETURNS].FREQ)=1 Or ([T RETURNS].FREQ)=7 Or ([T
RETURNS].FREQ)=11 Or ([T RETURNS].FREQ)=15 Or ([T RETURNS].FREQ)=14)
AND ((Rtn_Detail.Month_Processed) Is Null))
ORDER BY
[T RETURNS].RTN DESC;
from a query all records from Returns and only records from
ReturnDetails that = specific date. The below query almost works, the
problem I am having is when there is a record in ReturnDetails with a
date different than the criteria date, in this case 3/1/2006, the
record is not showing up in the results. Obviously this is becuase
Rtn_Detail.Month_Processed <> 3/1/2006 and it also isn't equal to null.
I want ALL records from the Returns table the meet the FREQ criteria
every time and cant get my head around a solution. I think I have been
looking at it to long as it doesnt seem like it should be that
difficult. Thanks in advance for any pointers...
SELECT [T RETURNS].RTN, [T RETURNS].ST, [T RETURNS].ENTITY, [T
RETURNS].[RTN TYPE], [T RETURNS].PREP, [T RETURNS].FREQ,
Rtn_Detail.Month_Processed, Rtn_Detail.Amount_Paid,
Rtn_Detail.Date_Delivered, Rtn_Detail.Review_Date, Rtn_Detail.Notes,
Rtn_Detail.Discount_Taken
FROM [T RETURNS] LEFT JOIN Rtn_Detail ON [T RETURNS].RTN =
Rtn_Detail.[RTN Number]
WHERE
((([T RETURNS].FREQ)=1 Or ([T RETURNS].FREQ)=7 Or ([T RETURNS].FREQ)=11
Or ([T RETURNS].FREQ)=15 Or ([T RETURNS].FREQ)=14) AND
((Rtn_Detail.Month_Processed)=#3/1/2006#))
OR ((([T RETURNS].FREQ)=1 Or ([T RETURNS].FREQ)=7 Or ([T
RETURNS].FREQ)=11 Or ([T RETURNS].FREQ)=15 Or ([T RETURNS].FREQ)=14)
AND ((Rtn_Detail.Month_Processed) Is Null))
ORDER BY
[T RETURNS].RTN DESC;