Advertisement

07.16.2008 at 06:31AM PDT, ID: 23569536
[x]
Attachment Details

Access query to find percentages

Asked by piemckay in SQL Query Syntax, Access Architecture/Design, Access Coding/Macros

Tags: SQL, Access, Access 2003

Hi,
My first post so apologies for length. I have recently been thrown in the deep end with an Access database and I'm having a problem with a query. I have one table that records results for chemical mixes. I am interested in the date and the value of the RightFirstTime field which will be "pass" or "fail". I basically want to create a query that shows me the percentage of passes over a period of time broken down by month. I have one query that will show me total records for each month and one that shows total passes but I can't get the two together to work out the percentage. I have attched my queries. I also created a month table just to look up month name.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
SELECT m.month, Count(L.RightFirstTime) AS Total
FROM  tbl_Lacquer_Mix AS L, tbl_month as m
WHERE ((L.DateTime) Between [start] And [end]) AND ((M.MonthId)=Month([L].[DateTime]))
group by m.month;
 
 
SELECT m.month, Count(L.RightFirstTime) AS Pass
FROM  tbl_Lacquer_Mix AS L, tbl_month as m
WHERE ((L.DateTime) Between [start] And [end]) AND ((M.MonthId)=Month([L].[DateTime])) and (l.RightFirstTime = "PASS")
group by m.month;
[+][-]07.16.2008 at 06:46AM PDT, ID: 22015833

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Access Architecture/Design, Access Coding/Macros
Tags: SQL, Access, Access 2003
Sign Up Now!
Solution Provided By: OnALearningCurve
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.17.2008 at 12:51AM PDT, ID: 22023170

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:28AM PDT, ID: 22023620

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628