Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-13-2017, 05:31 AM   #1
Lochwood
Newly Registered User
 
Join Date: Jun 2017
Posts: 22
Thanks: 9
Thanked 2 Times in 2 Posts
Lochwood is on a distinguished road
Counting Row Values

Ok, i am trying to count the values of field Activity which is a numeric field in 10 rows/records. i can use the totals command in the query that lets me choose the field and it counts up perfect on datasheet view. The issue i have is i cannot get this total onto a report as it doesn't show available to add when i add existing field.

What a i doing wrong?

Lochwood is offline   Reply With Quote
Old 09-13-2017, 05:34 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 4,539
Thanks: 91
Thanked 1,237 Times in 1,210 Posts
Minty will become famous soon enough Minty will become famous soon enough
Re: Counting Row Values

Can you show us your SQL query ?
__________________
A little thanks goes a long way
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

(Please use the scales on the left if we have helped!) Mark threads as Solved once you have an answer.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 09-13-2017, 05:36 AM   #3
Lochwood
Newly Registered User
 
Join Date: Jun 2017
Posts: 22
Thanks: 9
Thanked 2 Times in 2 Posts
Lochwood is on a distinguished road
Re: Counting Row Values

SELECT Sources.Source_ID, Sources.Serial_Number, Sources.Date_Of_Receipt, Sources.Form, Sources.Nuclide, Sources.Activity, Assets.Asset_Description, Sources.Reference_Date, Sources.Estimated_Activity_On_Receipt, Sources.Active_Dimensions, Sources.Overall_Dimensions, Sources.Description, Sources.Last_Test_Date, Sources.Test_Validity_Months, Sources.Risk_Assessment, Sources.Current_Location, Sources.Disposal_Date, Sources.How_Disposed
FROM Sources INNER JOIN Assets ON Sources.Serial_Number = Assets.Asset_Serial_Number
GROUP BY Sources.Source_ID, Sources.Serial_Number, Sources.Date_Of_Receipt, Sources.Form, Sources.Nuclide, Sources.Activity, Assets.Asset_Description, Sources.Reference_Date, Sources.Estimated_Activity_On_Receipt, Sources.Active_Dimensions, Sources.Overall_Dimensions, Sources.Description, Sources.Last_Test_Date, Sources.Test_Validity_Months, Sources.Risk_Assessment, Sources.Current_Location, Sources.Disposal_Date, Sources.How_Disposed;

Lochwood is offline   Reply With Quote
Old 09-13-2017, 05:44 AM   #4
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 4,539
Thanks: 91
Thanked 1,237 Times in 1,210 Posts
Minty will become famous soon enough Minty will become famous soon enough
Re: Counting Row Values

Okay - try adding the sum to your select and then it will become a field you can display

Code:
SELECT Sources.Source_ID, Sources.Serial_Number, Sources.Date_Of_Receipt, Sources.Form, Sources.Nuclide, Sources.Activity, Assets.Asset_Description, Sources.Reference_Date, Sources.Estimated_Activity_On_Receipt, Sources.Active_Dimensions, Sources.Overall_Dimensions, Sources.Description, Sources.Last_Test_Date, Sources.Test_Validity_Months, Sources.Risk_Assessment, Sources.Current_Location, Sources.Disposal_Date, Sources.How_Disposed, Sum(Sources.Activity) as TotalActivity
FROM Sources INNER JOIN Assets ON Sources.Serial_Number = Assets.Asset_Serial_Number
GROUP BY Sources.Source_ID, Sources.Serial_Number, Sources.Date_Of_Receipt, Sources.Form, Sources.Nuclide, Sources.Activity, Assets.Asset_Description, Sources.Reference_Date, Sources.Estimated_Activity_On_Receipt, Sources.Active_Dimensions, Sources.Overall_Dimensions, Sources.Description, Sources.Last_Test_Date, Sources.Test_Validity_Months, Sources.Risk_Assessment, Sources.Current_Location, Sources.Disposal_Date, Sources.How_Disposed;
__________________
A little thanks goes a long way
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

(Please use the scales on the left if we have helped!) Mark threads as Solved once you have an answer.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 09-13-2017, 05:57 AM   #5
Lochwood
Newly Registered User
 
Join Date: Jun 2017
Posts: 22
Thanks: 9
Thanked 2 Times in 2 Posts
Lochwood is on a distinguished road
Re: Counting Row Values

Yeh tried this bit it wont accept the code. see image,of what query looks like in data view.

Capture.PNG
Lochwood is offline   Reply With Quote
Old 09-13-2017, 06:03 AM   #6
arnelgp
Newly Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 4,497
Thanks: 47
Thanked 1,507 Times in 1,434 Posts
arnelgp has a spectacular aura about arnelgp has a spectacular aura about arnelgp has a spectacular aura about
Re: Counting Row Values

I think he want to Count
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 09-13-2017, 06:04 AM   #7
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 4,539
Thanks: 91
Thanked 1,237 Times in 1,210 Posts
Minty will become famous soon enough Minty will become famous soon enough
Re: Counting Row Values

That is a Access total row, not a field.
It's a nice display function they provide that provides no help for you in real form design unfortunately.

I can't remember what setting turns that on and off as I never use it...

__________________
A little thanks goes a long way
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

(Please use the scales on the left if we have helped!) Mark threads as Solved once you have an answer.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is offline   Reply With Quote
Old 09-13-2017, 08:02 AM   #8
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 2,528
Thanks: 57
Thanked 357 Times in 323 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Counting Row Values

You said this is for a report in the first post. Do you mean an actual report object?

If yes, then what you really want is the Group and Sort feature in the report's design screen. It should be in your Design tab in the ribbon when you're in design mode, and it will open up a 'Group, Sort, and Total' window at the bottom of your screen.

That will let you, well, group and sort and automatically add totals to the bottom of any group. (You can also create the totals by hand - they're just a textbox whose control source is something along the line of '=Sum([FieldToBeSummed]).)
__________________
"I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use and by some other means to give us knowledge which we can attain by them." -Galileo Galilei
Frothingslosh is offline   Reply With Quote
The Following User Says Thank You to Frothingslosh For This Useful Post:
Lochwood (09-14-2017)
Old 09-14-2017, 02:43 AM   #9
Lochwood
Newly Registered User
 
Join Date: Jun 2017
Posts: 22
Thanks: 9
Thanked 2 Times in 2 Posts
Lochwood is on a distinguished road
Re: Counting Row Values

Frothingslosh That worked a treat thanks

Lochwood is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting values zgray Queries 2 08-09-2013 12:16 PM
*?? Counting Values in the DB *?? bikeboardsurf General 2 02-02-2006 01:05 PM
Counting yes/no values MrZimma Queries 4 11-19-2004 01:14 PM
Is there a better way or counting values? RobynH Queries 3 01-10-2003 01:27 PM
Counting values in a field Neal Reports 3 01-14-2001 07:31 PM




All times are GMT -8. The time now is 09:28 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World