I am having a problem that might be more of an SQL problem than a CF
problem, but here it goes.

I have a single table with five fields, with the relevant ones including
a client number, a date field and a score.

There is always more than one date and score per client number.

CN Date Score
23 1/10/2004 50
23 1/18/2004 60
23 2/18/2004 40
27 2/11/2004 35
27 2/24/2004 31
27 1/19/2004 13
...
...
...

What I want to do is return the MOST recent information for EACH client.
So, I want my query result in this case to be as follows:

23 2/18/2004 40
27 2/24/2004 31
...
...
...

If I use syntax such as TOP 1, and sort the data in descending order by
Client Number and date, it returns the top value of the entire data set
(returns ONE record), not the top value PER CLIENT.

What am I missing here?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to