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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Access Expression DLOOKUP

Status
Not open for further replies.

gjmac2

IS-IT--Management
Mar 31, 2006
45
US
I need help in writing an expression in an Acess query. I need to look for the minimum date foe a particular set of records, and then return the coresponding value for that minimum date.

The table I am working with is: VW_SODIUM SURVEY LAB

I need the minimum date from field: Sampledatetime

I need the corresponding value from field: Serum Creatinine

I have tried using the Dlookup expression, but keep getting errors. Any help would be greatly appreciated.
 
some thing like this? I didn't use DLOOKUP, I used a subquery to get the MIN datetime...may need some tweaking:

Code:
SELECT [Serum Creatinine] FROM [VW_SODIUM SURVEY LAB] WHERE SampleDateTime = (SELECT Min(SampleDateTime) FROM [VW_SODIUM SURVEY LAB])

Leslie

In an open world there's no need for windows and gates
 
How about...
Code:
SELECT [Serum Creatnine], Min(Sampledatetime) As MinOfSampledatetime 
FROM [VW_SODIUM SURVEY LAB] 
GROUP BY [Serum Creatnine]


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top