finding most recent records

  • Thread starter Thread starter KRosier
  • Start date Start date
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;
 
Thank you! The first solution worked, but I will also try the others to
see which works best for this application (and to learn different ways
to do things!). I really appreciate the help.

Kathy
 
Back
Top