I have a simple SQL table that contains only a few fields. One field is "client", another is "my_date". There are a few other fields I need to pull too. But since there are so many dates for each client, I only want to output the most recent date for each client. I have tried both TOP and MAX(my_date) and I cannot seem to get it to do what I need. "my_date" is a datetime field. It still outputs everything. Do I need some sort of subquery ? As you can tell, I am no expert. Thanks for any help. -ljs
SELECT client, job, MAX(my_date), kbytes, filecount
FROM jobs_daily_summary
GROUP BY
client, job, kbytes, filecount
ORDER BY
client
SELECT client, job, MAX(my_date), kbytes, filecount
FROM jobs_daily_summary
GROUP BY
client, job, kbytes, filecount
ORDER BY
client