473,505 Members | 16,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Percentage of negative values out to the total number of fields

3 New Member
Hi

I have a query which has fields in showing how close a client is to their renewal date, or how overdue they are. I wanted to have a totals column at the bottom of the query showing what percentage of the total records had negative values in (therefore where the client is overdue) but the totals query option on tell me how many records there are in the query. How to I create a total row at the end of my query to give me the percentage of negative values in a certain field?

Please help!

Jess
Feb 22 '12 #1
5 2132
Rabbit
12,516 Recognized Expert Moderator MVP
You don't do that kind of stuff in a query. You do it in a report.
Feb 22 '12 #2
JessSmith
3 New Member
Thank you Rabbit. Would you be able to give me some help on how I would do that in a report? I am basically teaching myself to use Access and it is not always easy to do because examples never fully apply to my database!

Any help you could give me would be very appreciated!

Kind regards

Jess
Feb 23 '12 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Examples rarely apply fully because they are examples. They are meant to impart the general concepts that can then be used to solve a specific problem. In this case, you would probably use the DCount function to count the number of negative values and divide that by the total record count. Something like
Expand|Select|Wrap|Line Numbers
  1. =DCount("*", "tableName", "someValue < 0") / Count(*)
Feb 23 '12 #4
JessSmith
3 New Member
Thank you Rabbit - I will try to figure it out
Feb 23 '12 #5
NeoPa
32,557 Recognized Expert Moderator MVP
Assuming your field (NOT any related control) is called [Overdue], and that field has a negative value when something is overdue, you could try a control in your footer section with the following as its ControlSource :
Expand|Select|Wrap|Line Numbers
  1. =Sum(IIf([Overdue]<0,1,0))/Count([Overdue])
NB. This doesn't handle the situation where no records are shown. That would cause a Division by Zero error. If that needs to be handled then make sure to do so.
Feb 24 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1913
by: Dirk Hagemann | last post by:
Hi, Is there a datatype in python which allows no negative values? I subtract several times something from a value and I don't want to chek everytime if this value is still bigger or equal 0. ...
2
3700
by: luke | last post by:
Could anyone, please, explain to me why I have negative values in RowModCtr column in sysobjects table? I have tested that after I update statistics the RowModCtr column is reset to 0. But why do I...
1
1207
by: Daniel | last post by:
in C# how do i get to total number of kilobytes of memroy total and available for the current machine?
12
28948
by: deko | last post by:
Is there an easy way to make all negative values positive in a particular table? I've been experimenting with this: Dim rst As DAO.Recordset Set rst = db.OpenRecordset("tblNegValues") Do...
2
1921
by: Chris Leffer | last post by:
Hi. My application reads a table that stores data as time, eg: 02:17:31 I need to read this value and convert it to an integer, representing the total number of seconds. At this moment I am...
2
11102
by: patang | last post by:
I found the following to count the total number of VISIBLE rows of datagrid datagrid.visiblerowcount How do we count the total number of ACTUAL (not just visible) rows of datagrid? Thanks...
1
4785
by: illegal.prime | last post by:
So I see from the documentation here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCollectionsArrayListClassBinarySearchTopic.asp That the code uses the...
1
2560
by: Badis | last post by:
Hi guys, I have a negative values in my Amount column in GridView could U tell me how to display them with no (-) sign in front, knowing that my gridview is bounded to a DataView. Thanks
1
1965
by: Jbelf | last post by:
Project 2 asks you combine these exercises to expand upon the idea of a grading application with the following requirements: • The application should allow the user to perform score calculations...
3
3994
adascat
by: adascat | last post by:
Could anyone find out the problem why this is happening? The number of query values I am trying to insert is exactly the same as in my accdb file actually. Number of query values and destination...
0
7103
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...
0
7370
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...
1
7021
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...
0
7478
tracyyun
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...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
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 ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.