Thank you very much
You are right
The database is for student learning advance the table structure is :
date,name ,grade
I have query that get the data of a single student with fields :
date,name,grade ,advance (calculated field)
The problem is with the calculated field (advance) which should
compare the grade of the student with his(or her) preceding grade to
describe the state of the student either advancing or need some
helping procedure
I hope that information is describing my problem properly
Ok... try adding to your query a calculated field to look up the most recent
previous grade for this student:
Advance: DLookUp("[grade]", "[tablename]", "[Name] = """ & [Name] & """ AND
[Date] = #" & DMax("[Date]", "[tablename]", "[Name] = """ & [Name] & """ AND
[Date] < #" & [Date] & "#"))
This won't be as efficient as a subquery but should be ok for a small
database.
STRONG suggestions:
Name and Date are both reserved words and should NOT be used as fieldnames.
I'd suggest in any case using a unique student ID (names are NOT unique,
someday you might have two students both named Bill Smith).
It's better to store names in FirstName and Surname fields (so you can search
or sort by either one).
John W. Vinson [MVP]