Hello everyone, I know Access fairly well, but I am very, very weak on SQL. I have a very large table that I need to pull a grand Total from multiple fields. I have created a query to SUM all the fields individually, but I do not know how to add all the field totals to get one Grand Total. Here are 4 fields from my query as an example.
SELECT
Sum([Environmental Rounds].[Fire Extinguishers]) AS [SumOfFire Extinguishers],
Sum([Environmental Rounds].[Fire Exits]) AS [SumOfFire Exits],
Sum([Environmental Rounds].[Fire alarms]) AS [SumOfFire alarms],
Sum([Environmental Rounds].[Evacuation Map]) AS [SumOfEvacuation Map]
FROM [Environmental Rounds];
Please be specific in the programing help if you can, like I said, I am very weak in this area.
Thank you,
Nick
11 2355 MMcCarthy 14,534
Recognized Expert Moderator MVP
Hi Nick,
Try this ... -
SELECT
-
Sum([Environmental Rounds].[Fire Extinguishers]) AS [SumOfFire Extinguishers],
-
Sum([Environmental Rounds].[Fire Exits]) AS [SumOfFire Exits],
-
Sum([Environmental Rounds].[Fire alarms]) AS [SumOfFire alarms],
-
Sum([Environmental Rounds].[Evacuation Map]) AS [SumOfEvacuation Map],
-
[SumOfFire Extinguishers]+[SumOfFire Exits]+[SumOfFire alarms]+[SumOfEvacuation Map] As GrandTotal
-
FROM [Environmental Rounds];
-
Hi Nick,
Try this ... -
SELECT
-
Sum([Environmental Rounds].[Fire Extinguishers]) AS [SumOfFire Extinguishers],
-
Sum([Environmental Rounds].[Fire Exits]) AS [SumOfFire Exits],
-
Sum([Environmental Rounds].[Fire alarms]) AS [SumOfFire alarms],
-
Sum([Environmental Rounds].[Evacuation Map]) AS [SumOfEvacuation Map],
-
[SumOfFire Extinguishers]+[SumOfFire Exits]+[SumOfFire alarms]+[SumOfEvacuation Map] As GrandTotal
-
FROM [Environmental Rounds];
-
Thank you very much "M" that worked great.
I really appreciate the help.
Nick
MMcCarthy 14,534
Recognized Expert Moderator MVP
Thank you very much "M" that worked great.
I really appreciate the help.
Nick
No problem Nick
You're welcome
Mary
No problem Nick
You're welcome
Mary
_______________ _______________ _______________
Hi Mary, if I could bug you for one more problem I am having, I need to do a parameter for the query to prompt between two dates. I tried using:
Between [Enter Start Date] And [Enter End Date] under the "DATE" field, but it is returning all the records, not just the specified ones. The "DATE" field is formatted as Date/Time, so I don't know why it isn't working.
Again, any help would be appreciated.
Nick
MMcCarthy 14,534
Recognized Expert Moderator MVP
_______________ _______________ _______________
Hi Mary, if I could bug you for one more problem I am having, I need to do a parameter for the query to prompt between two dates. I tried using:
Between [Enter Start Date] And [Enter End Date] under the "DATE" field, but it is returning all the records, not just the specified ones. The "DATE" field is formatted as Date/Time, so I don't know why it isn't working.
Again, any help would be appreciated.
Nick
WHERE [DateField] BETWEEN #[Enter Start Date]# And #[Enter End Date]#
_______________ _______________ _______________
Hi Mary, if I could bug you for one more problem I am having, I need to do a parameter for the query to prompt between two dates. I tried using:
Between [Enter Start Date] And [Enter End Date] under the "DATE" field, but it is returning all the records, not just the specified ones. The "DATE" field is formatted as Date/Time, so I don't know why it isn't working.
Again, any help would be appreciated.
Nick
Hi Mary, I played with this a bit more, and got the date to work, but it is coming up with all the dates as individual records. I need it to still only give me one grand total. In other words combine all the months between the two dates together. I have a feeling this is more intense than I had expected.
Thanks Again,
Nick
MMcCarthy 14,534
Recognized Expert Moderator MVP
Hi Mary, I played with this a bit more, and got the date to work, but it is coming up with all the dates as individual records. I need it to still only give me one grand total. In other words combine all the months between the two dates together. I have a feeling this is more intense than I had expected.
Thanks Again,
Nick
Nick
Can you post the full SQL of the query
Mary
Hello Again Mary, thank you for sending the Date parameters.
I tried your parameter by plugging this into the SQL, and I am getting an error stating "Syntax error (missing operator) in query expression.
what did I miss? Here is my code as it stands so far.
Thanks again,
Nick
SELECT Sum([Environmental Rounds].[Fire Extinguishers]) AS [SumOfFire Extinguishers], Sum([Environmental Rounds].[Fire Exits]) AS [SumOfFire Exits], Sum([Environmental Rounds].[Fire alarms]) AS [SumOfFire alarms], Sum([Environmental Rounds].[Evacuation Map]) AS [SumOfEvacuation Map], [SumOfFire Extinguishers]+[SumOfFire Exits]+[SumOfFire alarms]+[SumOfEvacuation Map] AS GrandTotal,
WHERE [Date] BETWEEN #[Enter Start Date]# And #[Enter End Date]#
FROM [Environmental Rounds];
MMcCarthy 14,534
Recognized Expert Moderator MVP
Try this ... -
SELECT Sum([Environmental Rounds].[Fire Extinguishers]) AS [SumOfFire Extinguishers], Sum([Environmental Rounds].[Fire Exits]) AS [SumOfFire Exits], Sum([Environmental Rounds].[Fire alarms]) AS [SumOfFire alarms], Sum([Environmental Rounds].[Evacuation Map]) AS [SumOfEvacuation Map], [SumOfFire Extinguishers]+[SumOfFire Exits]+[SumOfFire alarms]+[SumOfEvacuation Map] AS GrandTotal,
-
FROM [Environmental Rounds]
-
WHERE [Date] BETWEEN #[Enter Start Date]# And #[Enter End Date]#;
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Chris Hall |
last post by:
The records in my database are displayed in a form as follows:
%>
<form action="report-ammend1.42.asp" method="post"name="form">
<table border=1>
<%
x = 1
|
by: beavenour |
last post by:
I am looking for some help creating a more universal function out of
this lame attempt at javascript. I have little experience with
javascript and want to be able to universalize this function. So how
do I change this script so that I can call any field or any number of
fields to be totaled? For example - calculate(myfield01, myfield02)
at one total field and calculate(myfield06, myfield08, myfield11) at
another total field instead of...
|
by: Richard Holliingsworth |
last post by:
Hello:
I'm building a report to display statistics on the entire database. I
have successfully built a report that groups the entire db on one field
and gives me a count of db records for the categories in that field and
a total record count for the db.
Now, I need to add another "total database" grouping to get another set
of record counts. I DO NOT want to nest this group, It MUST consider
ALL database records.
|
by: CSDunn |
last post by:
Hello,
I have 14 fields on a report that hold integer values. The field names
use the following naming convention: T1Number, T2Number ....T14Number.
I need to get a 'sub total' of all fields as follows:
=Sum() ... =Sum()
Then I need to get an average of all fields as follows:
|
by: Jana |
last post by:
Using Access 97.
Background:
I have a main report called rptTrustHeader with a subreport
rptTrustDetails in the Details section of the main report. The main
report is grouped by MasterClientID. There are also several other
subreports in the main report's footer. The rptTrustDetails subreport
has two grouping levels MasterClientID and ClientID, with headers and
footers for each grouping level. In the ClientID footer, I have an...
| |
by: meenakshia |
last post by:
hi forum:)
i have a form in which i have four input fields for pieces to be entered and 4 fields for amount
what i want is that the first pieces-t1 should be visible and rest three should not show up on the form unless asked for.
can anyone suggest me a way to do this
i have come across a lot of help areas where we can add input fields but in my case i have only predefined 3 fields
the code is below
<td>Pieces-t1</td>
<td><input...
|
by: Ecohouse |
last post by:
I'm working on a project that was dropped in my lap. It is in Access
2003. There are short time fields which get calculated values (eg.
1:30). But I will need to total up those values for reports in
qiueries. When I tried to drop one of the fields in the query builder
and used the total function the totals was way off.
So I was wondering what would be the best way to do this? Thanks in
advance for the help.
|
by: bonneylake |
last post by:
Hey Everyone,
Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also the parts section an i seem to be having trouble.
When i try to insert into the parts section i get the error Invalid character value for cast specification. But not sure what i am doing wrong. Here is what i am using to insert. All the sections...
|
by: bonneylake |
last post by:
Hey Everyone,
Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place.
what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly.
Currently this is what it does
serial information 1
parts 1
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |