You need to build a new query and save it.
SELECT DISTINCT ShipMonth as TheDate
FROM [Shipping Information] Inner JOIN [Orders]
ON [Shipping Information].[Job#]= [Orders].[Job#]
WHERE Invoiced = False OR FinalShipDate is Null
Call that qOpenMonth
Now add that query into your existing query and join on
qOpenMonth.TheDate to [Shipping Information].ShipMonth.
Drop all the screening of ship month in the where clause.
That should end up looking something like the following.
SELECT [Shipping Information].ShipMonth
, Orders.CustomerID
, Products.ProductName
, [Order Details].Quantity
, [Shipping Information].OriginalShipDate
, [Order Details]!Quantity*[Order Details]!UnitPrice AS ExtPrice
, Orders.[Job#]
, Orders.Invoiced
, Orders.PurchaseOrderNumber
, [Shipping Information].ShipDateChg1
, [Shipping Information].ShipDateChg2
, [Shipping Information].ShipDateChg3
, [Shipping Information].FinalShipDate
FROM (((Customers INNER JOIN Orders
ON Customers.CustomerID = Orders.CustomerID)
INNER JOIN (Products
INNER JOIN [Order Details] ON
Products.ProductID = [Order Details].ProductID)
ON Orders.[Job#] = [Order Details].[Job#])
INNER JOIN [Shipping Information]
ON Orders.[Job#] = [Shipping Information].[Job#])
INNER JOIN qOpenMonth
ON qOpenMonth.TheDate = [Shipping Information].ShipMonth
WHERE [Shipping Information].ShipYear=2008
ORDER BY [Shipping Information].ShipMonth, Products.ProductName,
[Shipping Information].ShipYear;
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
So I need to build a new query or is there a way to use my existing query and
just modify it? Here is my query in SQL view:
SELECT [Shipping Information].ShipMonth, Orders.CustomerID,
Products.ProductName, [Order Details].Quantity, [Shipping
Information].OriginalShipDate, [Order Details]!Quantity*[Order
Details]!UnitPrice AS ExtPrice, Orders.[Job#], Orders.Invoiced,
Orders.PurchaseOrderNumber, [Shipping Information].ShipDateChg1, [Shipping
Information].ShipDateChg2, [Shipping Information].ShipDateChg3, [Shipping
Information].FinalShipDate
FROM ((Customers INNER JOIN Orders ON Customers.CustomerID =
Orders.CustomerID) INNER JOIN (Products INNER JOIN [Order Details] ON
Products.ProductID = [Order Details].ProductID) ON Orders.[Job#] = [Order
Details].[Job#]) INNER JOIN [Shipping Information] ON Orders.[Job#] =
[Shipping Information].[Job#]
WHERE ((([Shipping Information].ShipMonth)<>"01 - JAN" And ([Shipping
Information].ShipMonth)<>"02 - FEB" And ([Shipping
Information].ShipMonth)<>"03 - MAR" And ([Shipping
Information].ShipMonth)<>"04 - APR" And ([Shipping
Information].ShipMonth)<>"05 - MAY" And ([Shipping
Information].ShipMonth)<>"06 - JUN" And ([Shipping
Information].ShipMonth)<>"07 - JUL" And ([Shipping
Information].ShipMonth)<>"08 - AUG") AND (([Shipping
Information].ShipYear)=2008))
ORDER BY [Shipping Information].ShipMonth, Products.ProductName, [Shipping
Information].ShipYear;