how to fetch latest record?

G

Guest

Hi,

I have a table which logs results for a product being tested. Table contains
product serial number, date tested and time tested, whether product passed
test or failed (test result) and some other details.

A product may be tested multiple times and it may pass first time and fail
at a latter time or vice versa. I like to fetch the product number and test
result with latest date and time.

How can create a query to do this job?

Thanks in advance for your help.

Regards,
Sarma
 
T

Tom Ellison

Dear Sarma Vanka:

The query should use a subquery in the WHERE clause to filter to just the
date/time (that's one column, not two, right?) that is maximum.

If you provide me with the SQL of a query that show what you want, but not
yet filtered to show only the most recent, I will probably be able to modify
that to do this.

Tom Ellison
 
G

Guest

If you are using a stored query, make it a totals query and instead of Group
By for the date and time, use Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top