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

Report based on date

Status
Not open for further replies.

signallt03

Technical User
Mar 14, 2003
21
US
I have a table that saves test scores based on SSN and Date. I want to generate a report that gives the last test score for each person
 
In your query, try making the SSN field a part of it and in the criteria type in the following:

[Enter Provider ID]

And for the next field, use the test scores and show them in decending order.
 
Create a query with the following SQL:

SELECT ssn,test_date,score from tbTest a
WHERE test_date IN (select max(test_date) from tbTest where ssn = a.ssn);

This query assumes a table name of TbTest and a test date field of test_date

The query will show latest test date and scroe for each person
 
yes, but what if one person failed to take it on the last date. How would i show there last completed test.
 
[Enter Provider ID]should have been [Enter SSN]. Sorry
 
mpastore-

Thanks for the help
It worked great!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top