L
Lori2836 via AccessMonster.com
Good morning. I have one table where there may be many of the same part
numbers with different criteria. The requestor only wants to see the one
with the earliest start date. How would I set that up? Here is the SQL
for the existing query.
SELECT [Fiscal Dates].[Fiscal Year], [Fiscal Dates].[Fiscal Week], [Master
Dispatch].[Item ID], [Master Dispatch].[Item Description], [Master Dispatch].
[MFG Order #], [Master Dispatch].[Order Status], [Master Dispatch].[Order Qty]
, [Master Dispatch].[Balance Due], [Master Dispatch].[Opern Description],
[Master Dispatch].[Work Center], [Master Dispatch].[Start Date], [Master
Dispatch].[Due Date]
FROM [Fiscal Dates] RIGHT JOIN [Master Dispatch] ON [Fiscal Dates].Date =
[Master Dispatch].[Start Date]
GROUP BY [Fiscal Dates].[Fiscal Year], [Fiscal Dates].[Fiscal Week], [Master
Dispatch].[Item ID], [Master Dispatch].[Item Description], [Master Dispatch].
[MFG Order #], [Master Dispatch].[Order Status], [Master Dispatch].[Order Qty]
, [Master Dispatch].[Balance Due], [Master Dispatch].[Opern Description],
[Master Dispatch].[Work Center], [Master Dispatch].[Start Date], [Master
Dispatch].[Due Date]
HAVING (((([Master Dispatch].[Opern Description]) Like "*face*" Or ([Master
Dispatch].[Opern Description]) Like "*machine*" Or ([Master Dispatch].[Opern
Description]) Like "*grumman*" Or ([Master Dispatch].[Opern Description])
Like "*turn*") And ([Master Dispatch].[Opern Description]) Not Like "*side
2*" And ([Master Dispatch].[Opern Description]) Not Like "*2nd*" And ([Master
Dispatch].[Opern Description]) Not Like "*finish grind*") AND (([Master
Dispatch].[Work Center])=" 18000"))
ORDER BY [Master Dispatch].[Item ID];
Thank you for any help you can give me!
numbers with different criteria. The requestor only wants to see the one
with the earliest start date. How would I set that up? Here is the SQL
for the existing query.
SELECT [Fiscal Dates].[Fiscal Year], [Fiscal Dates].[Fiscal Week], [Master
Dispatch].[Item ID], [Master Dispatch].[Item Description], [Master Dispatch].
[MFG Order #], [Master Dispatch].[Order Status], [Master Dispatch].[Order Qty]
, [Master Dispatch].[Balance Due], [Master Dispatch].[Opern Description],
[Master Dispatch].[Work Center], [Master Dispatch].[Start Date], [Master
Dispatch].[Due Date]
FROM [Fiscal Dates] RIGHT JOIN [Master Dispatch] ON [Fiscal Dates].Date =
[Master Dispatch].[Start Date]
GROUP BY [Fiscal Dates].[Fiscal Year], [Fiscal Dates].[Fiscal Week], [Master
Dispatch].[Item ID], [Master Dispatch].[Item Description], [Master Dispatch].
[MFG Order #], [Master Dispatch].[Order Status], [Master Dispatch].[Order Qty]
, [Master Dispatch].[Balance Due], [Master Dispatch].[Opern Description],
[Master Dispatch].[Work Center], [Master Dispatch].[Start Date], [Master
Dispatch].[Due Date]
HAVING (((([Master Dispatch].[Opern Description]) Like "*face*" Or ([Master
Dispatch].[Opern Description]) Like "*machine*" Or ([Master Dispatch].[Opern
Description]) Like "*grumman*" Or ([Master Dispatch].[Opern Description])
Like "*turn*") And ([Master Dispatch].[Opern Description]) Not Like "*side
2*" And ([Master Dispatch].[Opern Description]) Not Like "*2nd*" And ([Master
Dispatch].[Opern Description]) Not Like "*finish grind*") AND (([Master
Dispatch].[Work Center])=" 18000"))
ORDER BY [Master Dispatch].[Item ID];
Thank you for any help you can give me!