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

count function query

Hi
I'm trying to run two count querys on one column in access. its like an if statement, i want to count all rows where sale >=40 and name as pass and a second column where sale is <=39 as fail. can anyone help please?
Feb 6 '08 #1
3 1318
Hi
I'm trying to run two count querys on one column in access. its like an if statement, i want to count all rows where sale >=40 and name as pass and a second column where sale is <=39 as fail. can anyone help please?

Hi,

please go through this site

[link removed] you will get all details about querys and access.
Feb 6 '08 #2
Hi,

please go through this site

http://www.learnaccessnow.com you will get all details about querys and access.
hi thanks for that link. i forgot to mention in my post that i need to write it in sql.
Feb 6 '08 #3
MMcCarthy
14,534 Expert Mod 8TB
Hi
I'm trying to run two count querys on one column in access. its like an if statement, i want to count all rows where sale >=40 and name as pass and a second column where sale is <=39 as fail. can anyone help please?
The following SQL example should head you in the right direction.

Expand|Select|Wrap|Line Numbers
  1. SELECT Sum(IIf([sale]>=40, 1, 0) As Pass, Sum(IIf([sale]<40, 1, 0) As Fail
  2. FROM TableName;
  3.  
Feb 7 '08 #4

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

Similar topics

3
by: Matthias Haffke | last post by:
Ok, this is a tricky question for the pro's: My access sheet: line, id a, id b, val% ---------------- 1, a, ac, 0.04 2, a, ac, 0.28 3, a, ac, 0.015 4, a, ac, 0.205
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
3
by: Hyphessobricon | last post by:
Hallo, Indeed, a count of a query with a group by function gives more records than there are and so for-next structures don't function. How is this to be mended. Anyone? Everyone in fact....
6
by: dBNovice | last post by:
Hey group, I am trying to do a count of the number of papers in a table. The table has a PaperID that differentiates each paper , e.g. 004.1. Some papers are reused. The reused paper is given...
3
by: auron | last post by:
Hi there, I have a really stupid and banal problem with showing the results of a MySQL query in PHP, preciselly with MySQL count() function that gives to a variable in PHP the result. NOTE:...
1
by: heckstein | last post by:
I am working in Access 2002 and trying to create a report from our company's learming management system. I am not a DBA and most of my SQL knowledge has been self taught through trial and error. I...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
9
by: Akhenaten | last post by:
The following snippet (for whatever reason) returns no value for the count. Suggestions? $arr = array ("A", "B", "C", "D", "E"); foreach ($arr as $client) { $count = mysql_query('SELECT...
12
by: petter | last post by:
Hi! I have two questions: one question that regards the COUNT-function, and one about how to display a month even if I don’t have any data for that month. I have an Access database where I want...
14
by: zufie | last post by:
I have to create a QA report regarding callers calling into a phone hotline. The report consists of many checkboxes such as: Did the IBCCP agency contact you? Yes/NO How many days passed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.