Link to home
Start Free TrialLog in
Avatar of prairiedog
prairiedogFlag for United States of America

asked on

select latest records based on datetime

I have a log table like this:

username productID purchasetime
---------------------------------------------------
user1          12           01/02/1999
user1          12           03/05/2000
user2          23           02/03/2000
user2          31           02/04/2000
user2          23           02/04/2000
....

I want to select users that purchased product later than a predefined time, say 01/01/1998, but if a user purchase a same product at different dates, then only the latest one will be selected. How to write the query? Thanks a lot.
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prairiedog

ASKER

Melih, you are the man. Thanks a lot.

Jeffrey Zheng