I am having difficulties setting a criteria in DLookup.
How do I setup the Dlookup criteria to get the result if date of service = MinDOV?
Let's say i have the following table
PatientID--DateofVisit--ScreeningType--Result
1234--01/01/2011--LDL--140
if MinDate =DateofVisit it should give me 140.
Thank you,
John
How do I setup the Dlookup criteria to get the result if date of service = MinDOV?
Let's say i have the following table
PatientID--DateofVisit--ScreeningType--Result
1234--01/01/2011--LDL--140
if MinDate =DateofVisit it should give me 140.
Thank you,
John
Code:
SELECT [tbl_LDL-BSA1C].PatientID, Min([tbl_LDL-BSA1C].DateOfVisit) AS MinDOV, Max([tbl_LDL-BSA1C].DateOfVisit) AS MaxDov, [tbl_LDL-BSA1C].ScreeningType, DateDiff("ww",[mindov],[maxdov]) AS WeeksApart, DLookUp("result","tbl_ldl-bsa1c","dateofvisit='#mindov#'") AS Result
FROM [tbl_LDL-BSA1C]
GROUP BY [tbl_LDL-BSA1C].PatientID, [tbl_LDL-BSA1C].ScreeningType;
Last edited: