K
KRosier
Hi all!
I have a query that pulls information from three different tables. It
works great, but I would like it to return only the most recent record
for each CharID.
stats_tbl.dated is a date field
I believe I should be using the MAX function, but can't seem to get it
in the right place in the right syntax.
Any help would be very much appreciated.
Kathy
Here is the SQL
SELECT character_tbl.charID, character_tbl.Cname,
character_tbl.playerID, player_tbl.reg, stats_tbl.laston, stats_tbl.dated
FROM (player_tbl RIGHT JOIN character_tbl ON player_tbl.playerID =
character_tbl.playerID) LEFT JOIN stats_tbl ON character_tbl.charID =
stats_tbl.charID
WHERE (((player_tbl.reg) Is Null Or (player_tbl.reg)=0) AND
((stats_tbl.laston)<>"3_months"))
ORDER BY character_tbl.Cname;
I have a query that pulls information from three different tables. It
works great, but I would like it to return only the most recent record
for each CharID.
stats_tbl.dated is a date field
I believe I should be using the MAX function, but can't seem to get it
in the right place in the right syntax.
Any help would be very much appreciated.
Kathy
Here is the SQL
SELECT character_tbl.charID, character_tbl.Cname,
character_tbl.playerID, player_tbl.reg, stats_tbl.laston, stats_tbl.dated
FROM (player_tbl RIGHT JOIN character_tbl ON player_tbl.playerID =
character_tbl.playerID) LEFT JOIN stats_tbl ON character_tbl.charID =
stats_tbl.charID
WHERE (((player_tbl.reg) Is Null Or (player_tbl.reg)=0) AND
((stats_tbl.laston)<>"3_months"))
ORDER BY character_tbl.Cname;