Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Max Date Problem 1

Status
Not open for further replies.

gjmac2

IS-IT--Management
Mar 31, 2006
45
US
I am working in Microsoft AccessI have a table call Lab_results. I need to pull the value from the field "Creatine" based on the the last date in the field "Sampledatetime". Is there an expression I can use to acheive this?

Thanks
 
Code:
Select LR.Creatinie
From Lab_Results as LR
Where Sampledatetime IN 
    (Select Max(Sampledatetime) 
      From Lab_Results)
 
Thanks for the response. Is there a way to do this in Access Jet SQL? In other words, is there a way to input this into the criteria field in design view of the Access query?

Thanks
 
In a new empty query, switch it to SQL view as opposed to design or datasheet view (note the drop down arrow) and paste the SQL I posted replacing anything there (probably Select;). Switch back to design view. The In statement will appear as criteria which you could have entered manually.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top