T
toddlisa2
I have a report that displays totals from a union quey. I want to have
two where clauses: a date range and a status (sold, inventory, or
both). Here is where I am at:
1) Open Report kicks off Open Form (Criteria )
2) Criteria Form colects date range and status (group box radio button)
3) When you press Preview the form visible=false and the query that the
report uses takes the info from the form: [Form]!...
The problem I have is the WHERE for the staus will differ by sold_price
(>)(>=)(=) 0.
I can't set this in the report filter becuase the end result does not
contain sold_price.
Here is my union query (The AND will change to > for sold, >= for all
and = for inventory:
SELECT book_inventory.purchase_location AS Location, "Book" AS Type,
Count(*) AS Total,Sum(book_inventory.sold_price) AS Profit
FROM book_inventory
WHERE (((book_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (book_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((book_inventory.sold_price)>=0)
GROUP BY book_inventory.purchase_location
UNION ALL
SELECT CD_inventory.purchase_location, "CD",
Count(*),Sum(cd_inventory.sold_price)
FROM CD_inventory
WHERE (((CD_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (CD_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((cd_inventory.sold_price)>=0)
GROUP BY CD_inventory.purchase_location
UNION ALL SELECT movie_inventory.purchase_location, "Movie",
COUNT(*),Sum(movie_inventory.sold_price)
FROM movie_inventory
WHERE (((movie_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (movie_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((movie_inventory.sold_price)>=0)
GROUP BY movie_inventory.purchase_location;
Is the only way to do this with three reports and three buttons on the
form based on what you want or is there a better way. I hope that
makes sense.
two where clauses: a date range and a status (sold, inventory, or
both). Here is where I am at:
1) Open Report kicks off Open Form (Criteria )
2) Criteria Form colects date range and status (group box radio button)
3) When you press Preview the form visible=false and the query that the
report uses takes the info from the form: [Form]!...
The problem I have is the WHERE for the staus will differ by sold_price
(>)(>=)(=) 0.
I can't set this in the report filter becuase the end result does not
contain sold_price.
Here is my union query (The AND will change to > for sold, >= for all
and = for inventory:
SELECT book_inventory.purchase_location AS Location, "Book" AS Type,
Count(*) AS Total,Sum(book_inventory.sold_price) AS Profit
FROM book_inventory
WHERE (((book_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (book_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((book_inventory.sold_price)>=0)
GROUP BY book_inventory.purchase_location
UNION ALL
SELECT CD_inventory.purchase_location, "CD",
Count(*),Sum(cd_inventory.sold_price)
FROM CD_inventory
WHERE (((CD_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (CD_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((cd_inventory.sold_price)>=0)
GROUP BY CD_inventory.purchase_location
UNION ALL SELECT movie_inventory.purchase_location, "Movie",
COUNT(*),Sum(movie_inventory.sold_price)
FROM movie_inventory
WHERE (((movie_inventory.purchase_Date)>=[forms]![Date
Range]![BeginDate] And (movie_inventory.purchase_Date)<=[forms]![Date
Range]![EndDate]))
AND ((movie_inventory.sold_price)>=0)
GROUP BY movie_inventory.purchase_location;
Is the only way to do this with three reports and three buttons on the
form based on what you want or is there a better way. I hope that
makes sense.