473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Report problem with GROUP BY and SUM() => Error 3612

Hi,

I want to create a report.
The query looks like this:
SELECT A.Name, Sum(A.Hours) AS FROM A
GROUP BY A.Name;

Now I want in my report to have a last line with the total hours from
all. It doesn't work with an simple SUM-Text-filed, I will see an
error message (3612) that this is nor possible with GROUP BY.

Is it possible to generate with SQL a total sum?
Greets
Hans
Nov 12 '05 #1
4 6066
DFS

"Hans" <ha*****@hotmail.com> wrote in message
news:1e**************************@posting.google.c om...
Hi,

I want to create a report.
The query looks like this:
SELECT A.Name, Sum(A.Hours) AS FROM A
GROUP BY A.Name;

Now I want in my report to have a last line with the total hours from
all. It doesn't work with an simple SUM-Text-filed, I will see an
error message (3612) that this is nor possible with GROUP BY.
Hmmm. You should be able to drop a Sum(NameOfSumFieldFromQuery) control on
the report and have it work OK.

Another option: In the Total control on the report, set the ControlSource =
DSum("Hours","Table")

Is it possible to generate with SQL a total sum?
Greets
Hans

Nov 12 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Not w/ JET (Access) SQL.

First off, your query is incorrect. It should be like this:

SELECT A.Name, Sum(A.Hours) AS TotHrs
FROM A
GROUP BY A.Name;

You can create a totals text box on a Report (we are talking about an
Access Report object, aren't we?) in the report footer that has a
ControlSource of:

=Sum(TotHrs)

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP/zaY4echKqOuFEgEQI+AACg9M5z4OZ8/swJNxRwVkSWt6BEx2oAmwWF
k4rLpNlQdhg6v7IOq/w3Sc4E
=pXxN
-----END PGP SIGNATURE-----
Hans wrote:
Hi,

I want to create a report.
The query looks like this:
SELECT A.Name, Sum(A.Hours) AS FROM A
GROUP BY A.Name;

Now I want in my report to have a last line with the total hours from
all. It doesn't work with an simple SUM-Text-filed, I will see an
error message (3612) that this is nor possible with GROUP BY.

Is it possible to generate with SQL a total sum?
Greets
Hans


Nov 12 '05 #3
>
You can create a totals text box on a Report (we are talking about an
Access Report object, aren't we?) in the report footer that has a
ControlSource of:

=Sum(TotHrs)


The Problem is, that this is not possible, because of the error 3612.
You can't have a textbox with a sum in the footer, when you have an
SQL group by statement.
greets
Hans
Nov 12 '05 #4
DFS
"Hans" <ha*****@hotmail.com> wrote in message
news:1e**************************@posting.google.c om...

You can create a totals text box on a Report (we are talking about an
Access Report object, aren't we?) in the report footer that has a
ControlSource of:

=Sum(TotHrs)

The Problem is, that this is not possible, because of the error 3612.
You can't have a textbox with a sum in the footer, when you have an
SQL group by statement.

Hans,

Not sure what you're trying to do.

You can definitely have a textbox with a sum in the report footer (and group
footers) of a report having a GROUP BY query as its recordsource.

Are you trying to use a GROUP BY query as the control source for the sum
textbox?


greets
Hans

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Baker | last post by:
Hi: At the bottom of a report, I wish to sum all the amounts that appear in a field called Discount$ that appears on the report. I am not doing this summing in the query that supports the report...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
1
by: Wayfarer | last post by:
I've built a report using a aggregate query that is grouped by Month + Year, Program and Name. When I feed the date ranges as query parameters, it will very properly print out a report that shows...
1
by: BerkshireGuy | last post by:
Hello everyone, I have an agency report where the lines looks something like this: Agency Code Percent Sold Total Premium ------------------------------------------ J1 50% ...
2
by: Ian Hinson | last post by:
Hi, In an MDB report I was able to obtain an Orders total in a Group Footer by setting a control's ControlSource to: =Sum(*) In the Detail section of the report are controls bound to: (1)...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
7
by: Sunil Korah | last post by:
Hi, I haven't used access reports much. I have a problem in getting the total of a group. I have 3 fields, ProgName (Program name), Pname (Participant's name) and PCategory (Participant...
6
by: DavidOwens | last post by:
Sub PreviewReport_Click() On Error GoTo Err_PreviewReport_Click Dim stRepName As String: Rem Holds the Report name Dim stDispId As String: Rem Holds the Dispenser ID Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.