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

Count /Group By

Greetings,
As part of my Highschool project I had to come up with a themed database with a bunch of tables to query from, so I came up with a 'police' database. I am trying to get a count of all data thats in my tblTrafficCodes.Description column and have them grouped so it would look like this:

Count Description
3 Tickets
2 DUI
3 Fights ... and so on and so on.

The issue I'm running into is that I get this instead:
Count Description
1 Tickets
1 Tickets
1 Tickets
1 DUI
1 DUI..... and so on.

I complicated this a bit by having a 5 table join and not sure if thats also contributing to my issue.

I'm learning both SQL and how to do queries via the Design view. Can't quite figure out how to do this in both

Can anyone help me please!
Feb 19 '10 #1
2 2255
yarbrough40
320 100+
please show me what sql code you have tried so far. Also I would need to see a sample of the table you are attempting to query. depending, you should be using something like:
Expand|Select|Wrap|Line Numbers
  1. SELECT Description, COUNT(Description) as Total
  2. FROM tblTrafficCodes 
  3. GROUP BY Description
Feb 20 '10 #2
NeoPa
32,556 Expert Mod 16PB
You can see the same query (QueryDef) in either SQL view OR Design view.

I concur with Yarborough in that seeing your SQL would help us to help you more specifically, though what he's already posted may well be enough to set you on the right track.
Feb 21 '10 #3

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

Similar topics

2
by: Paxton | last post by:
Hi, I'm trying to display the total page views per page within a given date range, but the correct SQL is seemingly beyond me. I get the correct result with a straightforward Group By and Count...
3
by: Dagpauk | last post by:
Assume the following table holding information about the planning date and execution date for an imaginary "objects" ObjectPlan ObjectID PlannedDate ExecutedDate 1 19.03.04 28.03.04...
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: Igor Kryltsov | last post by:
Hi,I am using slightly modified example posted by Doug Younger and answered by Tom Lane :)(http://archives.postgresql.org/pgsql-sql/1999-08/msg00159.php) I have the following 2 tables: Table...
1
by: sammy | last post by:
If you have a select with 2 attributes where you group by one attribute and do a count() for the second attribute, if the count() is 0 then that row is never displayed. How would you instead see...
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="...
3
by: Auddog | last post by:
I have the following query that works in mysql: select id, order_no, price, count(item_no), sum(price) from production WHERE item_no = '27714' group by item_no; When I setup my query in php,...
3
by: cmartin1986 | last post by:
I have written a sql query and I need it to return 0 when it doesn't find any matches to my criteria. I have tried adding iif statements, tried sum, and just Count, all of these methods work fine to...
1
by: plaguna | last post by:
How can I Count the number of Customers that a Sales Person had in a City X? The idea is to Group By and Sub Group By , and then Count the rest of the fields. This is the scenario: ………….…..etc ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
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...

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.