Zed
07-17-2002, 07:29 AM
I have multiple records in a table with various timestamps. Is there a way to build a query that returns only the most recent record and not an aggregation of all the records with a maximum time?
Here is a sample of what my table is like:
Name Last Visit (date/time format) Widgets Purchased
Bill May 12, 1997 12:05:01 2
Bill Aug 11, 1999 10:05:00 1
Bob Dec 1, 2000 09:05:01 5
Bob Oct 10, 1999 05:20:10 6
Bob May 3, 2000 08:34:55 2
Mary Nov 1, 1999 10:02:00 4
And I'd like to pull the following results with my query
Name Last Visit Widgets Purchased
Bill Aug 11, 1999 10:05:00 1
Bob Dec 1, 2000 09:05:01 5
Mary Nov 1, 1999 10:02:00 4
Whenever I use the Max(Last Visit), I get a sum of widgets and not the number that they purchased at their last visit.
Thanks,
Zed
Here is a sample of what my table is like:
Name Last Visit (date/time format) Widgets Purchased
Bill May 12, 1997 12:05:01 2
Bill Aug 11, 1999 10:05:00 1
Bob Dec 1, 2000 09:05:01 5
Bob Oct 10, 1999 05:20:10 6
Bob May 3, 2000 08:34:55 2
Mary Nov 1, 1999 10:02:00 4
And I'd like to pull the following results with my query
Name Last Visit Widgets Purchased
Bill Aug 11, 1999 10:05:00 1
Bob Dec 1, 2000 09:05:01 5
Mary Nov 1, 1999 10:02:00 4
Whenever I use the Max(Last Visit), I get a sum of widgets and not the number that they purchased at their last visit.
Thanks,
Zed