473,382 Members | 1,329 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,382 software developers and data experts.

Calculate Percentages

6
I created a table in Access 2007 called "Accidents" . I have a field called
"Fault Description" which allows the user to select the option of "Fault" or
"No fault" from a list. In the report footer, I want a number to reflect the percentage of records that have the option of "Fault" selected. I want to run this report by date range, i have already added the date field.
Apr 26 '10 #1
3 3423
rwalle
47
create a query with parameter to restrict the dates then based on this query create a second query to obtain the "fault" count , and other query to "No fault" count, then create a form with 2 unbound date fields that ask for initial and end dates, and a button to run a report based on the parameter query, you can now see all the registers within your dates window and in the report footer you can write down the "fault" and "No fault" total counts and create a new calculated field that give you a percent of "Fault" over "No fault" or over Total register count
Apr 26 '10 #2
ADezii
8,834 Expert 8TB
Here is the general idea without the Date Criteria included. To include the Percentage of Faults in the [Fault Description] Field for all Records in the Accidents Table, place the following Expression in the Control Source of a Text Box in the Report's Footer:
Expand|Select|Wrap|Line Numbers
  1. =Format(DCount("*","Accidents","[Fault Description] = '" & "Fault" & "'")/DCount("*","Accidents"),"Percent")
Apr 27 '10 #3
NeoPa
32,556 Expert Mod 16PB
If your data is shown in a control in the Detail section of the report, then these values can be aggregated directly (You can sum the value in the detail rather than having to use a Domain Aggregate function - DSum() - to process through the data again).

Something like :
Expand|Select|Wrap|Line Numbers
  1. =Format(Sum(IIf([txtFaultDescription]='Fault',1,0)/Count([txtFaultDescription]),'Percent')
This will automatically incorporate any date criteria applied to the report.
Apr 27 '10 #4

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

Similar topics

0
by: Avinash Dhoot | last post by:
Hi, I have a 5 row table with the following values. key value 1 5 2 10 3 15 4 15 5 5
0
by: michael | last post by:
I've got a 3-column layout using percentages to define width of each div-column. #left-col { width: 20%; background-color: green; float:left; } #center-col { width: 60%; background-color: blue;...
7
by: richard | last post by:
I have a table with 5 fields into which the user will enter numbers, which must add up to 100%. Say the fields are Toyotas, Missans, Mazdas, Hondas and Other. I am having trouble writing a query...
2
by: Dot net work | last post by:
Hello. Is it possible to build up a dynamic server side table, and specify the column widths as percentages? I've tried this: Set the table width to 100%, then: FirstColumn.Width = New...
26
by: Mike Barnard | last post by:
Hi all. I am playing with html and css. I don't (yet) have a working site, I'm just trying to build a working, basic template I can use for a couple of ideas I have. I recall reading a...
7
by: Jurek | last post by:
I have 10+ experience in C/C++ - mostly automation and graphics. I have never written any business apps though. Recently I've been asked to write a simple report that would calculate sales...
9
by: AZKing | last post by:
Hi all, I would like to know how do you go about calculating percentages in Access. For example, in a form I have 3 combo boxes with drop down menus where a user can select "Yes" or "No" and a...
39
by: Umesh | last post by:
Plese help. Is there any software by which we can do that?
3
by: martin DH | last post by:
Access 2003 I have a table (TASKS) filled with data from an external source. The table lists several tasks for employees to complete and has a text field (STATUS) that identifies where in the...
0
by: marcopolo8 | last post by:
Wierd thing is happening during my xHTML development. When I set the width attribute of a text field in a form and use percentages, if the text field's value is extremely long, IE6 automatically...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.