home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Desperately need help - stressed - counting in Access

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2273
Discussions: 200,959, Posts: 2,379,539, Members: 246,329
Old October 24th, 2004, 02:51 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Jul 2004
Posts: 11
Desperately need help - stressed - counting in Access

hi there;

hope you can help, i have a query that displays all the people in my database who are male, then another to for all the people who are female.

Rather than displaying in a form the word "male" or "female" written however many times, i want it to return a number, so it can tell me how many people there are that are male and how many are female.

I have tried using this SQL (count function) thingy and all i get is problems when i try and work it.

I am hopeless at this so could anyone offer me a way to filter data and count the results rather than listing them?

i'll want to use the results in a form (to display) and then again in a report, so i may need to write it to another table for storage, which is cool.

please help, seriously stressed.

Dan
danlindley is offline   Reply With Quote
Old October 24th, 2004, 03:02 PM     #2 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,391
select sex, count(sex)
from tablename
group by (sex)

this will return

female 30
male 40

or something like that
but that is the generic format of the count function
maybe post up the sql so we can look at it


You have to remember when using the COUNT function, you have to use the GROUP BY clause. Once you do that, anything in teh SELECT part must also be in teh group by.
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is online now   Reply With Quote
Old October 25th, 2004, 06:19 AM     #3 (permalink)
Junior Member
 
Join Date: Jul 2004
Posts: 11
Thank you,

after a hell of a lot of gramatical changes, i finally got it to work, and this i am grateful for. my problems originated with a semicolon that access placed in the code, and i got a lot of "punctuation incorrect" errors.

Thanks.
danlindley is offline   Reply With Quote
Old October 25th, 2004, 01:12 PM     #4 (permalink)
Ultimate Member
 
Tekk's Avatar
 
Join Date: Oct 2001
Location: Pasadena, CA
Posts: 2,177
Yeah access automatically places ';' in SQL statements at the end (or what it assumes to be the end). Can sometimes cause things to screw up.
__________________
YAH! I knew you'd be jealous
Tekk is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heads Up, Oh Minister of Avatars! Knothead IMO Community 5845 November 20th, 2009 02:48 PM
Asus makes good mother boards right? ScottyRolen General Tech Discussion 14 October 15th, 2004 03:17 AM
How do i deal with stress? DRIVER J.R. IMO Community 24 September 10th, 2003 05:37 PM
system ini file dezzzi28 General Tech Discussion 10 August 27th, 2002 03:52 PM
hypersentitive??? NeoStarO1 IMO Community 12 May 29th, 2002 10:35 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2970)
The disrespect of Obama by Russian .. (44)
Making Health Care Worse (180)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
Regular Build (11)
windows 7 problem (7)
Laptop with wireless problem. (5)
windows vista security holes (13)
Is the PSU I received dead? (13)
Print spooler problem (16)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
Recent Discussions
Is the PSU I received dead? (13)
Print spooler problem (16)
Nvidia GTX 260 problem (0)
windows vista security holes (13)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
Open With ..... Win7 (1)
webcam (0)
upgrade for hp a6101 (0)
Laptop with wireless problem. (5)
Modern Warfare 2: Who Bought It? (64)
tv not turn on-makes clicking sound (2)
CPU fan stops spinning randomly (9)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Point and Shoot Camera Suggestions. (4)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)


All times are GMT -4. The time now is 10:28 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28