Queries :: Calculate Percentage On Grouped And Filtered Data

Jul 20, 2015

I'm very new to Access and I'm attempting to write an expression in a query that will calculate the % of the count of "Exchange" field (Exchange is a text field and is grouped and the count based on each unique name) where the total count is based on the filter where "Group" = 'FS' or 'S'.

The below seems to work, but there is a better way of going about this (especially if I have to add more filter criteria). I added a pic of the query I'm trying to build.

PercentofTotal: (Count([Exchange])/DCount(Count([Exchange]),"[Holdings]","[Asset Group] = 'FS' OR [Asset Group]='S'"))

View Replies


ADVERTISEMENT

Modules & VBA :: Get Filtered / Grouped External Data Into MS Access Table

Oct 20, 2014

I have an Excel file with a name range "DBIAS" which identifies all database data.

Then I have an Access file with a form to import that database (better, that named range) into an Access table. While importing, I have to filter some records or grouping by some field.

I cannot run correctly a VBA code to get data (filtered and/or grouped) from that name range and save those records to an existing or a brand new table.

I could get those data as DAO.recordset and printed out with "Debug.print" on immediate window, but I cannot complete the final step: writing those records to a table.

View 3 Replies View Related

Queries :: Calculate Percentage In Query

Apr 16, 2013

How to calculate the percentage of kilometers per order compared to the total number of kilometers per carrier.

In the attached screenshot send queries where I need formula.

Mileage on the orders of the field called "Korkma" . The formula should look like: # [Korkm] / [total kilometers per carrier] #.

I do not know how to get the total mileage driven by the carrier (the carrier is in the query in the Field Name Plate) for the month.

For example:

date 1.1.2013.,Plate:Pribus Korkm= 37
date 2.1.2013.,Plate: Pribus,Korkm=56
date 10.1.2013.,Plate: Pribus, Korkm= 70
Formula: [37]/[163] = 0,23
[56]/[163]= 0,34
[70]/[163]= 0,43

View 1 Replies View Related

Queries :: Calculate Percentage Per Passengers In Query

Apr 19, 2013

To calculate the percentage of the number of passengers in the total number of passengers per single order using query:

Code:
SELECT

Code:
A.Date, A.Plate, A.Pax, A.Agency, A.Code, IIf ([pax]> 0, Round ([Pax] / (SELECT Sum (Pax) FROM Sheet2 as B WHERE B.Date = A.Date and B.code = A.code), 2), 1) AS KOR
FROM Sheet2 AS A
ORDER BY A.Date;

Query works fine in all cases except one, and that is when the encounter a same order in one day

01/04/2013. D_1 0pax
01/04/2013. D_1 5pax

in this case the formula gives a coefficient of 1 to 0 passengers and coefficient of 1 to 5 passengers, should be given a score of 0 0 of passengers and 1 to 5 passengers

View 1 Replies View Related

Queries :: Calculate Differential Between Average Earnings And Percentage Within Crosstab Query

Apr 9, 2014

I obtained data for earnings by industry for men and women over time (5 years). I developed crosstab query that showed the average earnings for men and women for the 5 years.

Now I want within this query to calculate the differential between men and womens average earnings and calculate a percentage within this crosstab query. I tried to use Expressionbuilder with little luck.

View 6 Replies View Related

Queries :: Count Same And Differences / Calculate Percentage Of Number Of Same Over Total Amount

Jul 9, 2013

I am trying to count how many of the "same" and "differences", as well as calculate the percentages of the number of "same" over the total amount. To clarify, I work at a nursing home, and I need to calculate the number of people who were admitted to our facility and then to the hospital for the same diagnosis, and a different diagnosis. Then, out of the total number of people who were admitted to the hospital from our facility, I need to calculate how many of those people had the same diagnosis or a different diagnosis.

Also, I need to categorize these diagnosis by each type of diagnosis.

View 14 Replies View Related

Queries :: Selecting Max From Grouped Data

Nov 26, 2014

I am having trouble writing what I think should be a fairly straight forward query... I am have a table with 2 fields, the first contains a list of subjects, the second contains a list of scores that students got in their tests in that subject.

So the data looks like this:

Maths 54
Maths 69
Maths 41
English 71
English 55
Art 44
Art 43
Art 66

I would like to write a query that selects only the highest score for each subject and presents it like this:

Maths 69
English 71
Art 66

View 4 Replies View Related

Calculate Percentage

Mar 22, 2008

In a report, I need to calculate the percentage of clients that respond "Yes" to a question on a survey. I need to create a query that will return the count of the number of "Yes" responses, and the number of total responses.
For example, if 10 clients complete the survey, and seven respond "Yes", I need the 2 fields in the query to be 7 and 10. So far, I have only been able to do this using multiple queries.
Thank you.

View 1 Replies View Related

Need To Add A Column That Would Calculate Percentage

Oct 26, 2006

Does anyone know how to add a column to an existing table that would calculate percentage?

Thank you very much in advance!!!

View 3 Replies View Related

Queries :: Append Only Data On Filtered Form

Jul 2, 2015

I have a list of dates in my Form1.

When I click on a date it opens Form2 to show that dates specific details.

I would like a macro on Form2 that appends the filtered results to another table.

I think I am just struggling with the references to Form2 in the append query criteria.

View 1 Replies View Related

Queries :: Export With Formatting Filtered Data

Aug 3, 2015

I have a centralised database that imports data from several other databases at the click of a button to produce a "global" query of data.

This is presented as a datasheet form which I am then able to filter. This is a subform to my main form.

I have a button on my Main form with a macro to ExportWithFormatting to excel. I was under the impression that exportwithformatting exported the filtered data.

How to export my filtered query data to Excel and not the whole query data?

View 3 Replies View Related

Calculate Percentage Within Currency Brackets

Jan 7, 2008

Hey,

I'm unsure of how to do this one, any help would be appreciated.

The database I'm working on has around 2000 records within the parent table. These reflect projects around the world.

the child table has records on how much these projects cost.

I would like to calculate the % of projects cost less than 50,000, then, the % of projects between 50,000-100,000 and so on.

i'm not entirely sure how to do this, anyone have any ideas?

Thanks

View 1 Replies View Related

Calculate Percentage On Access Form

May 4, 2006

Hi, Thanks in advance. I am trying to calculate percentage, it has to round to the nearest, and also if the percentage is greater than 100 then it has to write 100%.
formulae: c=(a/b)*100,
example: c=(8/3)*100 =266.66% but this is more than 100% so i need this as 100%
example2: c=(2/3)8100=66.66% but i need it to round as 67%

i've 3 controls on a form a,b,c. so c has to calculate by itself when they enter data on a and b.
thanks,
sam

View 1 Replies View Related

Reports :: Calculate And Display Percentage In Columns

Nov 7, 2013

I have an Access 2009 report that displays the sums at the bottom of some columns. Is there a way to calculate and display the percentage one sum is of another?

Column1 Column2

Total 12,000 9,800
Percentage 100 % 81.7 %

View 1 Replies View Related

How To Calculate A Percentage Of Two Fields And Format Properly

Feb 11, 2013

I have two fields CountOFAppeal Description and Amount Solicited.

I just want to get the percentage of response.

So this is what I used:

=[CountOfAppeal Description]/[Amount Solicited]*100

When I go into the properties to format it to % and add decimal places I get a crazy number

2520.46% When it should be 25.20%

When I change the format to general number the decimal point is in the right place 25.20.

View 2 Replies View Related

General :: Making A Query To Calculate The Percentage Of Change?

Mar 27, 2013

I have this table

Year AvgOfValue
2005 109.061690295772
2009 106.801581389669

I have to calculate the percentage of change of the values. I have very basic knowledge. How can I make a query to calculate the percentage of change?

View 2 Replies View Related

Modules & VBA :: Calculate Percentage Of Total Proposal Amount

Dec 18, 2014

I have two numbers, i need to calculate how much percentage of one is the other. E.g

num_1 = 100
num_2 = 10
percent = 10%

Users enter a dollar amount (retainer) and my code should calculate the percent of the total proposal amount.

Actual Code

Private Sub cmdSubmit_Click()
Dim intProposalTotal As Double 'if i use interger i get "overflow" error
intProposalTotal = Nz(DLookup("ProposalTotal", "qryPropsalTotalForRetainer", "proposal_id=" & Me.proposal_id), 0)

[Code] .....

billing_retainer_percent is formatted to Percent with 0 decimals. In the actual table Type - Number, Format - Percent, Field Size - Single. What i get is 100% instead of 10%.

View 4 Replies View Related

General :: How To Calculate Percentage Of Correct Responses PER RECORD

Sep 12, 2013

What I'm looking to do is calculate the success rate (%) of compliance rates with Quality Control paperwork. Essentially, each record has 12 "check box" fields representing the different QC sheets that are submitted each day.

QCflavourChange
QCfillerOperator
QCblowMoulding
QCtorqueTest
QCnetContents
QClabeller
QCpacker
QCpalletiser
RMpreform
RMclosure
RMlabel
RMcarton

I have been able to find the code for counting the success rate of a specific type of QC sheet across multiple days worth of testing, eg:

=Sum(IIf([RMpreform]=True,1,0))])

But I have been unable to determine how I can count the total of all the successful fields listed above, across a single record.

View 7 Replies View Related

Merging Grouped Data?

Apr 3, 2008

So i'm not sure where this post belongs as it may encompass several items.
I have an excel sheet where every row has an email address and a product purchased. I've imported it all into access but would like to run a query to find out how many people that bought x purchased y. Or tell me how many people that x did not buy a,b, or c.

Part of the problem is that each record is one product. My data looks like this:

email: Product:
e1 p2
e1 p7
e1 p33
e2 p2
e2 p9
e3 p1
e4 p1
e4 p3

I was able to group some of the data by email address in access but can't figure out a good way to query it. I'm thinking I probably need to merge the data where each unique email address is a record and the products have all the products purchased instead of just one but I really have no clue how to do that.

Is this easily do-able? how would I go about this?
Thanks alot!

View 2 Replies View Related

Queries :: Add Comparatives To Grouped Totals Queries

May 23, 2013

I have a totals query of phone call charges by phone number and I want to show a "budget" amount for each number (same amount for all) and a variance against that budget.

How I can do this at the grouped (phone number) level rather than at the individual call level?

Please see current query below:

SELECT Call1CurrentTbl.電話番号(MSN), Sum(Call1CurrentTbl.料金) AS 料金OfSum
FROM Call1CurrentTbl
GROUP BY Call1CurrentTbl.電話番号(MSN), Call1CurrentTbl.[レコード区分], Call1CurrentTbl.表示区分
HAVING (((Call1CurrentTbl.[レコード区分])=2) AND ((Call1CurrentTbl.表示区分)=10));

View 2 Replies View Related

Queries :: Count Function Which Calculate Data With Date Criteria

Jan 20, 2014

Looking to have a count function which calculate data in sense like if records found on 1-jan-2014 the it give answer as 1, same as records for 2-jan-2014 it should return 2 and so on .. in short the criteria must look and give same number for same dates starting from 1

View 8 Replies View Related

Queries :: Add Columns To Grouped Max (date) Query

Mar 14, 2013

I have a database that tracks students and their test scores. I am trying to figure out a way to where it will pull the student's latest test score and compare it to see if they fall within standards. So far I have 3 tables.

tblStudents
studentID
studentName
studentEmail

tblResults
resultID
resultStudent
resultDate
resultTest
resultScore

tblTests
testID
testName
testPassScore

The query I have written looks like this: SELECT tblStudents.studentID, Max(tblResults.resultDate) FROM tblStudents LEFT JOIN tblResults ON tblStudents.studentID = tblResults.resultStudent GROUP BY tblStudents.studentID." The data pulls just fine at this point. What I'm trying to figure out is how to then add more columns to this query to start doing comparisons. When I try to add more columns it tries to use them for additional grouping and adds many more records.

View 8 Replies View Related

Queries :: Totals Query Grouped Across Columns

Mar 5, 2015

I have simple table data structured as follows;[Origin], [Code], [Weight]. The Code field is a lookup field that will contain one of 8 choices; 10, 13, 13c, 23, 25, 27, 27a, & other. The other fields are pretty much self explanatory. Sample data would look like this:

Code:
Origin Code Weight
Edison 13 4.25
Edison 13c 2.87
Piscataway 10 5.45
Middlesex 23 1.24
Edison 13 5.21

What I need to create is a totals query where I first group by origin value, then a column for each "code" value which totals the weight for that "code". A sample output would look something like this:

Code:
Origin 10 13 13c 23 25 27 27a other
Edison 9.46 2.87
Piscataway 5.45
Middlesex 1.24

The only way I can think to accomplish this is to restructure the original table to include a field for each code and enter the weight in the appropriate 'code' field. If this is the only solution then Ill have to live with it, but is there any way to create this output using my original structure?

View 1 Replies View Related

Queries :: Count Active Members Grouped By Month

May 5, 2015

I am trying to get active member count by month in MS Access.

Table looks like this:

admin ID firstName sDate eDate 1 Adam 01/01/2015 01/04/2015 2 Ben 01/02/2015 15/04/2015 3 Carl 01/02/2015 13/03/2015 4 Don 13/01/2015

Required output would be like this

2015-Jan: 2
2015-Feb: 4
2015-Mar: 3
2015-Apr: 3
2015-May:1
etc..

I got this far:
SELECT DISTINCT count(a.ID) as mCount, year(dimDate.Date) as [Year], month(dimDate.Date) as [Month]
FROM admin AS a INNER JOIN dimDate ON (dimDate.Date >= a.sDate AND dimDate.Date <= a.eDate) OR (dimDate.Date >= a.sDate AND dimDate.Date = null)
GROUP BY year(dimDate.Date), month(dimDate.Date)
ORDER BY year(dimDate.Date), month(dimDate.Date)

Query4 mCount Year Month 31 2015 1 71 2015 2 44 2015 3 13 2015 4

View 2 Replies View Related

Queries :: Grouped Query That Returns A List Of All Periods

Nov 21, 2013

I have a grouped query that returns a list of all periods qryPeriod

Code:
SELECT [tblMaster].Year, [tblMaster].Week, ([Year] & " - " & Right(0 & [Week],2)) AS Period
FROM [tblMaster]
GROUP BY [tblMaster].Year, [tblMaster].Week, ([Year] & " - " & Right(0 & [Week],2));

Year | Week | Period
2013 | 48 | 2013 - 48
2013 | 49 | 2013 - 49
2013 | 50 | 2013 - 50
2013 | 51 | 2013 - 51
2013 | 52 | 2013 - 52
2014 | 1 | 2014 - 01
2014 | 2 | 2014 - 02
2014 | 3 | 2014 - 03
2014 | 4 | 2014 - 04

[code]...

these are then used as the start of a between lookup against [tblMaster] along with the last record in the qryPeriod (2014 - 04)...I will need 4 queries so If someone can sort out last period - 8 I can probably do the others.would DLookUp do this say return the last 4 values, Last 6 Values and Last 8 Values

View 6 Replies View Related

Queries :: Concatenate Multiple Records Grouped By Date?

May 2, 2014

I have a rates table with 3 fields : [RateDate], [CurrencyID], [FXRate]

I also have a currencies table with 2 fields : [CurrencyID], [CurrencyCode]

Where [CurrencyCode] is just the 3-character currency code (i.e. EUR, GBP, USD etc.)

The rates table uses a composite primary key across [RateDate] and [CurrencyID] - i.e., there should only be one unique record for each combination of date and currency.

Not every date will be present in the table and, within each of those dates, not every currency will be present (but at least one, obviously)

I want to write a query which will return two fields. The first field will contain all of the unique dates in the table for which the [FXRate] field (for any currency) is blank / null. Straightforward enough :

Code:
SELECT [tblRates].[RateDate]
FROM [tblRates]
INNER JOIN [tblCurrencies]

[Code]....

But this gives me a separate record for each date / currency combination in the returned dataset. I just want one record per date and all of the currency codes in a single string (separated by some delimiter) as a text field.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved