mjfroggy
07-15-2009, 03:26 PM
OK so I have a table called teams which is where all teams for a game are listed. Teams possibly get or loose members every month.
So like for example one month I may get one new member where another team leader gets 0 new team members and then the following month the other team leader may get 2 new team members (and loose one or two) while the other team has no changes.
So My teams table has the following
rowid | memername | teamleader | assign_date
where the assign_date colum is the date the user was assigned to the teamleader. Now the key is I want to be able to look at what team members a team leader had in September and then also view what team members they had in October
I am trying to use a query like this
SELECT teamleader = 'jsmith'
AND assign_date = ( SELECT max( assign_date )from teams);
when I run the query I get only one result since of course it is just pulling what ever the highest date is for this teamleader
So what suggestions would people have for storing which players get assigned to which teamleader and then also keep a historical view. now that I may have a player assigned to one team leader for one month and then 2 months dowjn the road he/she may be assigned to another teamleader. however I want the teamleaders to be able to go backwards and look at what team members they had for different months. so like a team lead will be able to select a month (i.e., july) and see which players where assigned to them.
thanks all
So like for example one month I may get one new member where another team leader gets 0 new team members and then the following month the other team leader may get 2 new team members (and loose one or two) while the other team has no changes.
So My teams table has the following
rowid | memername | teamleader | assign_date
where the assign_date colum is the date the user was assigned to the teamleader. Now the key is I want to be able to look at what team members a team leader had in September and then also view what team members they had in October
I am trying to use a query like this
SELECT teamleader = 'jsmith'
AND assign_date = ( SELECT max( assign_date )from teams);
when I run the query I get only one result since of course it is just pulling what ever the highest date is for this teamleader
So what suggestions would people have for storing which players get assigned to which teamleader and then also keep a historical view. now that I may have a player assigned to one team leader for one month and then 2 months dowjn the road he/she may be assigned to another teamleader. however I want the teamleaders to be able to go backwards and look at what team members they had for different months. so like a team lead will be able to select a month (i.e., july) and see which players where assigned to them.
thanks all
