Solved

needs help in query

Posted on 2011-09-20
6
369 Views
Last Modified: 2012-05-12
Summary report that list aggregate counts of students that graduated from abc public colleges and universities. In 2010, by the level at which the degrees were awarded are associate, baccalaurate, master, doctoral. Within each field of study that is accounting, nursing, phy, engineering, etc. Query should list only the top 25 fields of study and the number of degrees awarded for each degree level. The top 25 is determine by the total degree awarded for each field of study

Gfice int college id number
gstid int student id number
gdob student date of birth
Ggradyr int year the student graduated
gdegcip int national field of study code
gdeglvl int degree level
cpicode int national field of study code
cipdesc char national field of study description
0
Comment
Question by:mustish1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 

Author Comment

by:mustish1
ID: 36567758
Degree lvel codes
03 Associate Degree
05 Bachelors Degree
07 Masters degree
09 doctors degree
0
 
LVL 7

Accepted Solution

by:
BusyMama earned 250 total points
ID: 36567846
Two queries -

One showing the Top 25 for 2010
Second showing the details for the identified 25

Query 1:
SELECT TOP 25 Count(gstid), Ggradyr, gdegcip
FROM TableName
GROUP BY Ggradyr, gdegcip
HAVING Ggradyr = "2010":

Query 2:
SELECT Query1.gdecip, gdeglvl, count(gstid)
FROM Query1, TableName
GROUP BY Query1.gdecip, gdeglvl
HAVING Query1.Ggradyr = "2010";
0
 
LVL 18

Assisted Solution

by:deighton
deighton earned 250 total points
ID: 36567867
if you can write your aggregate query, ignoring the top 25 part of it, you can the make that a sub query and query


e.g.

SELECT TOP 25 * FROM (..your aggregate query in here.including CountOfDegrees..) AS SubQ ORDER BY CountOfDegrees

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 18

Expert Comment

by:deighton
ID: 36567892
oops, I see you are in ACCESS though, I am thinking along the lines of SQL server
0
 

Author Comment

by:mustish1
ID: 36567902
Np I just need query either in access or sql server
0
 
LVL 7

Expert Comment

by:BusyMama
ID: 36567930
deighton, I believe you can do it that way, even in Access, if you go to the SQL view of the query.  I didn't even consider that.  Good thought!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Queries: Select, then Append, then Delete 8 33
What is needed to become a DBA? 7 46
SQL Server Error: 4060 8 21
Multiple tables for a tabbed form 2 22
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question