Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Totals in Querys

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick Bradbury - 08 Nov 2005 23:33 GMT
Hi

Currently I am using a  report to show details of Orders that have been paid
for in any specific period, the SQL is as follows

SELECT tblOrders.CustomerID, tblCustomers.Company_Name, tblOrders.OrderID,
tblOrders.Order_Date, tblOrders.Date_Paid, tblOrders.Invoice_Paid,
qryOrder_Details.Copy_Line_Total, qryOrder_Details.Product_Line_Total,
[Copy_Line_Total]+[Product_Line_Total] AS LineTotal, [LineTotal]*0.175 AS
VATCharged
FROM tblCustomers INNER JOIN (tblOrders INNER JOIN qryOrder_Details ON
tblOrders.OrderID = qryOrder_Details.OrderID) ON tblCustomers.CustomerID =
tblOrders.CustomerID
WHERE (((tblOrders.Date_Paid) Between [Start Date] And [End Date]) AND
((tblOrders.Invoice_Paid)=Yes) AND ((tblOrders.Invoice_Cancelled)=No))
ORDER BY tblCustomers.Company_Name;

What I would like to do is summarise the data by order, this query outputs
each line of each order e.g. if OrderNo 1300 has 5 items then there are 5
lines on the report. I just want the totals for Order No 1300.

Hope this makes sense

Nick
John Vinson - 09 Nov 2005 05:27 GMT
>What I would like to do is summarise the data by order, this query outputs
>each line of each order e.g. if OrderNo 1300 has 5 items then there are 5
>lines on the report. I just want the totals for Order No 1300.

Change it to a Totals query by clicking the Greek Sigma icon on the
query design toolbar (looks like a sideways M). Leave the default
Group By on the Orders table fields, and change it to Sum (or Count,
or whatever is appropriate) on the OrderDetails fields.

                 John W. Vinson[MVP]    
Nick Bradbury - 09 Nov 2005 09:34 GMT
Problem solved,

Many Thanks

Nick

>>What I would like to do is summarise the data by order, this query outputs
>>each line of each order e.g. if OrderNo 1300 has 5 items then there are 5
[quoted text clipped - 6 lines]
>
>                  John W. Vinson[MVP]
Nick Bradbury - 09 Nov 2005 10:10 GMT
Problem solved. Many Thanks

Nick

>>What I would like to do is summarise the data by order, this query outputs
>>each line of each order e.g. if OrderNo 1300 has 5 items then there are 5
[quoted text clipped - 6 lines]
>
>                  John W. Vinson[MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.