Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old April 30th, 2002, 06:36 PM
wargod1999 wargod1999 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: new york, ny, US
Posts: 4 wargod1999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wargod1999
Need help with a query

I'm trying to make a query using SQL that specifies the number of test takers in a specific date range, grouped by race, and grouped by age but in groups of 10(ex. age 30-40, 41-50, etc...). It should look something like this...
|30-40|41-50|51-60|61-70|71+|
white| | | | | |
black| | | | | |
asian| | | | | |



sorry for the horrible drawing, I don't know how to explain it any better. Please contact me ASAP because I'm running into my deadline!!!! HELP!!!!

Reply With Quote
  #2  
Old April 30th, 2002, 06:38 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: Need help with a query

I don't believe with ANSI standard SQL that you are going to be able to achieve output like you are looking for. What DBMS are you using? It is possible that you might be able to use specific features of it (like stored procedures in MSSQL) to obtain that output....


Reply With Quote
  #3  
Old April 30th, 2002, 06:44 PM
wargod1999 wargod1999 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: new york, ny, US
Posts: 4 wargod1999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wargod1999
RE: Need help with a query

I'm using MS Access 2002. do you know if this can be done with this program? If I cant use SQL, is it possible to achieve this with VBA?

Reply With Quote
  #4  
Old April 30th, 2002, 06:48 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: Need help with a query

Well, I can tell you that you can definately create a report in Access that will give you what you want. I haven't messed with Access2002, but I can tell you that it can be done with Access97. Look into the reporting features of the program. You should be able to set labels for your age ranges, and labels for your race. Then do queries such as:

SELECT count(*) FROM table WHERE age <= 40 AND age >=30 AND race='white'

to fill in the values....


Reply With Quote
  #5  
Old April 30th, 2002, 07:15 PM
wargod1999 wargod1999 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: new york, ny, US
Posts: 4 wargod1999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wargod1999
RE: Need help with a query

sorry, but for some reason Its returning zero.

Reply With Quote
  #6  
Old April 30th, 2002, 07:55 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Need help with a query

Well, you will need to fine tune the query for your particular table and such. That was just an example...

Reply With Quote
  #7  
Old May 6th, 2002, 03:23 PM
wargod1999 wargod1999 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: new york, ny, US
Posts: 4 wargod1999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to wargod1999
RE: Need help with a query

Ok, I used this code for every field in my table I made in a report so for this example, this field is under Age 30-40, next to Asian.

SELECT Count(survey.[age:]) AS age3040
FROM Survey
WHERE Survey.[Age:]>=30 and Survey.[age:]<=40 And (((Survey.[Date:]) Between forms!daterange3!startdate3 And forms!daterange3!enddate3)) and Survey.[Which of these categories describes you?]="Asian";

This works acctually! the only problem is is that it only can handle 6 races (30 fields). When I try to add another race (which is five fields more), and try to point the field to the query it says "query too complex". What I did was take every query for each field and put that into another query and set that as the record source of the report. so when I add another five queries to the query master, it says too complex. I also tryed grouping the queries together by race so the query master would only have 5 queries, but it doesn't work. I hope I'm not confusing you, sorry. based on this code, do you have any ideas that would be able to strip it so it wouldn't be so complex (even though it doesn't look so complex to me).

Reply With Quote
  #8  
Old July 12th, 2002, 08:25 PM
jediknight219 jediknight219 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 jediknight219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Need help with a query

I know this question's been sitting here for a while, but I saw the answer in a devshed.com article once.

Check out:
http://www.devshed.com/Server_Side/MySQL/MySQLWiz/page1.html

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Need help with a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway