multiple query report???

hejan11

Registered User.
Local time
Today, 09:09
Joined
Dec 2, 2016
Messages
7
i used 3 queries to build a report, but it seems to have duplicate data
 
hejan11,
I agree with Chris --congrats or too bad...
What exactly are you trying to do?---some details to help readers understand.
Tell us about your queries.
 
Im trying to create a daily query which shows all the orders that have been put into that system that day. Its shows all the orders (order id, quantity, price, items). But i had to create multiple queries because of different calculations. I hve tried everything else it wont work. This is the only way it worked. But the data for wach order is being repeated. For example, coca-cola is being ordered with chicken burger. Its written twice
 
Perhaps you should show readers your
-tables and relationships
-your query sql
 
a couple of points to consider:
-use names with no embedded spaces and no special characters (&*^%$#@? etc)
-use alphanumerics and underscore(_) only(it will reduce syntax errors)
-add selling price or agreedTo price to the OrderDetail table.
(Your Price in the menuitem table refers to the current price, and if and when you change that price, all of your records in the OrderDetails table will be affected--not good for history and/or auditors)
-if you use Now() it records date and time in 1 field--you don't need a separate field for time, necessarily.
-reports have their own sorting and group, so make use of that rather than trying to rely on query.

What is the recordsource of the report?
I do not understand the need for 3 separate queries, but you know your business and we don't.

You could try this sql as a start to another query
Code:
select orderid
,orderdate
,ordertime
,orderdetails.quantity
,(orderdetails.quantity * menu.price) as LineAmount
,employeeID
,item
,delivery
from order,orderdetails,menu
where
order.orderid =orderdetails.orderid and
orderdetails.menuitem=menu.item and 
orderdate = Date

orderDate = Date <=== just gets orders placed on this date

Good luck.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom