J
Jeff
Ok gang. Here is something complicated, well, at least to me anyway.
Using Access DB
I have a table in my DB called members. In that table, I have 2 tables I
will be using "username" and "points"
Now, I also have a table called all_matches. This table contains every match
report. Over 25,000 of them. I have a "username" field an "outcome" field an
"username1" field and "extra_match" field.
What I need to do, is make a query that takes the username from table
"members" and find :
using the "username" field in the members table, i need to obtain stats
that give me the following.
1.) how many total matches played. Which would simply be a count of the
username field in the all_matches table. Since people report the match win
or lose.
2.) how many wins, where extra_match = 0. This would be a count of username
in the all_matches table where "outcome" = 'Win' and extra_match=0.
3.) how many wins, where extra_match = 1. This would be a count of username
in the all_matches table where "outcome" = 'Win' and extra_match=1
4.) how many losses, where extra_match = 0. This would be a count of
username in the all_matches table where "outcome" = 'Lose' and
extra_match=0..
5.) how many losses, where extra_match = 1. This would be a count of
username in the all_matches table where "outcome" = 'Lose' and
extra_match=1.
6.) Then divide the wins into the total games and get a win %
now I did this, using top 50 so it wasn't too intensive, since there are so
many lines in the all_matches table. But what I can't do is get the sort
right. But I think if i can do this in access, instead of doing it on an asp
page, it will be easier.
I had one that was done for me on another DB, but I was unable to modify it
for this DB.
I can show you the script of what I did on the asp page, but it is rather
sloppy, and it doesn't work anyway. So I need help creating this SQL within
access as a query.
I know this is a lot,
But any help would be appreciated. I know basic SQL, but I don't know inner
and outer joins.
THanks
bam
Using Access DB
I have a table in my DB called members. In that table, I have 2 tables I
will be using "username" and "points"
Now, I also have a table called all_matches. This table contains every match
report. Over 25,000 of them. I have a "username" field an "outcome" field an
"username1" field and "extra_match" field.
What I need to do, is make a query that takes the username from table
"members" and find :
using the "username" field in the members table, i need to obtain stats
that give me the following.
1.) how many total matches played. Which would simply be a count of the
username field in the all_matches table. Since people report the match win
or lose.
2.) how many wins, where extra_match = 0. This would be a count of username
in the all_matches table where "outcome" = 'Win' and extra_match=0.
3.) how many wins, where extra_match = 1. This would be a count of username
in the all_matches table where "outcome" = 'Win' and extra_match=1
4.) how many losses, where extra_match = 0. This would be a count of
username in the all_matches table where "outcome" = 'Lose' and
extra_match=0..
5.) how many losses, where extra_match = 1. This would be a count of
username in the all_matches table where "outcome" = 'Lose' and
extra_match=1.
6.) Then divide the wins into the total games and get a win %
now I did this, using top 50 so it wasn't too intensive, since there are so
many lines in the all_matches table. But what I can't do is get the sort
right. But I think if i can do this in access, instead of doing it on an asp
page, it will be easier.
I had one that was done for me on another DB, but I was unable to modify it
for this DB.
I can show you the script of what I did on the asp page, but it is rather
sloppy, and it doesn't work anyway. So I need help creating this SQL within
access as a query.
I know this is a lot,
But any help would be appreciated. I know basic SQL, but I don't know inner
and outer joins.
THanks
bam