Any excel . . . er, Access . . . genuises online?

Entity

Lifer
Oct 11, 1999
10,090
0
0
I've got a question...kinda hard to explain. Basically I've got this huge dataset with student information in -- names, ID numbers, course name, year taken, etc. I'm trying to isolate all the kids who took their first class in 2000 (the data goes back to 1988 and up to 2003) and pull the records from that. I think I can do this in access, but I'm wondering if there would be any way to do it in excel. Any ideas?

LastName FirstName ID CourseName Teacher CourseID Year CreditsEarned Term

That's what the column setup looks like.

Ok, I've imported it into Access now. Ideas?

Rob
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: KEV1N
Custom Filter!

Yeah, I've guessed that much, just not having much luck with it. It isn't even my job to be doing it, I'm just helping a friend out.

It's a fun puzzle for me at the least. I'm bored and watching Futurama.

Rob
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Originally posted by: Entity
Originally posted by: KEV1N
Custom Filter!

Yeah, I've guessed that much, just not having much luck with it. It isn't even my job to be doing it, I'm just helping a friend out.

It's a fun puzzle for me at the least. I'm bored and watching Futurama.

Rob

How can you be bored watching futurama :Q :Q
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Hmm....ok, imported into Access now. Trying to figure out the steps I'd go through to do this; I can narrow it easily to people who have taken classes in 2000, but not people whose first class was in 2000. Any ideas?

Rob
 

amdskip

Lifer
Jan 6, 2001
22,530
13
81
I'd personally just leave it in excel and do the custom filter. I don't know how to do it in access, sorry.
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
How would you do it in excel? Seems a bit complex. -- I can find records of everyone who took classes in 2000, but not their first class in 2000.

Rob
 

calpha

Golden Member
Mar 7, 2001
1,287
0
0
Simplest way to do it in access is with a sub-query, written not using the query design wizard, but from the sql designer, writing the sql by hand

Select * from <table name> where Year = 2000 and id not in (select id from <table name> where year < 2000).

You'll have to use brackets around the column names and table name
select * from [mytable] where [mytable].[year] = '2000' and [mytable].[id] not in (select [mytable].[id] from [mytable] where [mytable].[year] = '2000')
if you've used dates as your datatype for year the 2000 will be enclosed by # signs, and should be a between #1/1/2000# and #12/31/2000#
If you've used text as your datatype for the year, and if it's still MM/DD/yyyy you'll use ' instead of #s.

Alternatively, if each student has the same id for every year they took a class, you don't need a subquery. You can use the having clause.

Select student_id from <table name> group by student_id having min(year) = '2000'
 

T2T III

Lifer
Oct 9, 1999
12,899
1
0
Originally posted by: Entity
How would you do it in excel? Seems a bit complex. -- I can find records of everyone who took classes in 2000, but not their first class in 2000.

Rob

You could select the column sort order. First, sort on the column to sort the years. Then, perform a 2nd level sort to group those who took their first class in that year. This is using Excel.

Granted, you are getting several different pieces of advice - but, there are literally 10 different ways to do this - hence, the different advice.
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: Tiles2Tech
Originally posted by: Entity
How would you do it in excel? Seems a bit complex. -- I can find records of everyone who took classes in 2000, but not their first class in 2000.

Rob

You could select the column sort order. First, sort on the column to sort the years. Then, perform a 2nd level sort to group those who took their first class in that year. This is using Excel.

Granted, you are getting several different pieces of advice - but, there are literally 10 different ways to do this - hence, the different advice.

Thanks. The cheif problem I was/am having is that I don't know Excel very well, and this was the format my friend was given the file in. I'm going to sleep now and will attack it again in the morning. It seems like I'm getting either too many or not enough results, depending on how I narrow down the data.

I figured out what I think should be the logical heuristic for it, I just don't know how to apply it:

1. Select students who took classes in 2000.
2. Subtract students who took classes before 2000 from that dataset.
3. Extract the full records of the remaining students.

That should be it, right? That way I'm only getting the results (data) from students who took classes in 2000, but not before.



Sleepytime. I've got to get up in 5 hours and this isn't even my problem.

Rob
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Just tried this, but seem to be getting too many results (is it returning a cartesian product?):

SELECT *
FROM AllMath
WHERE (((AllMath.Year)=2000)) AND (((AllMath.ID) NOT IN (SELECT ID FROM AllMath WHERE (YEAR<2000))));

Rob
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Holy nested queries batman. I finally got it.

SELECT *
FROM AllMath
WHERE (((AllMath.ID) IN (
SELECT DISTINCT ID
FROM AllMath
WHERE (((AllMath.Year)=2000) AND ((AllMath.ID NOT IN (SELECT ID FROM AllMath WHERE ((AllMath.Year)<2000))))))));

Thanks for all the help, guys.

Rob
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |