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.

Different Outcomes between sum and non-sum in SQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AccessHelp - 14 Nov 2005 18:05 GMT
I am creating a SQL query for my report.  The problem is when I sum the
transactions in SQL query, the total number comes out different from the
total number that I don't sum in SQL query.

Does anyone know why?

Thanks.
KARL DEWEY - 14 Nov 2005 18:40 GMT
Please post your SQL statement and tell us how you are totaling the number
without the SQL.

> I am creating a SQL query for my report.  The problem is when I sum the
> transactions in SQL query, the total number comes out different from the
[quoted text clipped - 3 lines]
>
> Thanks.
AccessHelp - 14 Nov 2005 19:11 GMT
Hi Karl,

Thanks Karl.  I took the numbers (both sum and non-sum) from [Total Accum
Time] and totaled those numbers.  The total number didn't come out the same.

Here is my SQL statement:

SELECT qryBilling_Summary.[Aff Group], qryBilling_Summary.[Client ID],
qryBilling_Summary.[Client Legal Name], Sum(qryBilling_Summary.[Total Accum
Time]) AS [SumOfTotal Accum Time], Sum(qryBilling_Summary.[Interim Amount
Billed]) AS [SumOfInterim Amount Billed], Sum([Interim Amount Billed]-[Total
Accum Time]) AS [Diff of Interim & Actual]
FROM qryBilling_Summary
GROUP BY qryBilling_Summary.[Aff Group], qryBilling_Summary.[Client ID],
qryBilling_Summary.[Client Legal Name]
HAVING (((qryBilling_Summary.[Aff Group]) Like nz([Please Enter Aff
Group],"*")) AND ((qryBilling_Summary.[Client ID]) Like nz([Please Enter
Client ID],"*")) AND ((Sum(qryBilling_Summary.[Interim Amount Billed]))=0));

> Please post your SQL statement and tell us how you are totaling the number
> without the SQL.
[quoted text clipped - 6 lines]
> >
> > Thanks.
Chris2 - 15 Nov 2005 04:26 GMT
> > > I am creating a SQL query for my report.  The problem is when I sum the
> > > transactions in SQL query, the total number comes out different from the
[quoted text clipped - 13 lines]
>
> Here is my SQL statement:

<snip>

AccessHelp,

The query, realigned for readability (when this posts to the
newsgroup, there will be line-wraps, my apologies):

 SELECT qryBilling_Summary.[Aff Group]
       ,qryBilling_Summary.[Client ID]
       ,qryBilling_Summary.[Client Legal Name]
       ,Sum(qryBilling_Summary.[Total Accum Time]) AS [SumOfTotal
Accum Time]
       ,Sum(qryBilling_Summary.[Interim Amount Billed]) AS
[SumOfInterim Amount Billed]
       ,Sum([Interim Amount Billed]-[Total Accum Time]) AS [Diff of
Interim & Actual]
   FROM qryBilling_Summary
GROUP BY qryBilling_Summary.[Aff Group]
       ,qryBilling_Summary.[Client ID]
       ,qryBilling_Summary.[Client Legal Name]
 HAVING (((qryBilling_Summary.[Aff Group]) Like nz([Please Enter
Aff Group],"*"))
    AND  ((qryBilling_Summary.[Client ID]) Like nz([Please Enter
Client ID],"*"))
    AND  ((Sum(qryBilling_Summary.[Interim Amount Billed]))=0));

What is your sample data?

What values are you entering at the prompts?

What are the results you are getting?

What do you mean by "non-sum"?

Sincerely,

Chris O.
AccessHelp - 15 Nov 2005 20:26 GMT
Chris2,

Thanks for the message.  If you would, please look up the tread that I
re-posted today with the tread name "Please Help!".

I really need help with that problem.  Thanks.

> > > > I am creating a SQL query for my report.  The problem is when
> I sum the
[quoted text clipped - 56 lines]
>
> Chris O.
 
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.