Print only the last record entered

zxmax

Registered User.
Local time
Today, 14:01
Joined
Mar 14, 2004
Messages
16
Greeting,
I have a subform of a main form, that records "bloodPressure" of a patient, the table that the subform uses has 3 feilds, "BloodPressureID", "TodayDate" and "BloodPressure" ,

Now when i print a report, i have only one field for the "bloodPressure" where i want to show only the last record, i don't want to show all the previous record,

how do i tell the report to print only the last entry in that BloodPressure Table ?

Thanks
 
zxmax said:
Greeting,
I have a subform of a main form, that records "bloodPressure" of a patient, the table that the subform uses has 3 feilds, "BloodPressureID", "TodayDate" and "BloodPressure" ,

Now when i print a report, i have only one field for the "bloodPressure" where i want to show only the last record, i don't want to show all the previous record,

how do i tell the report to print only the last entry in that BloodPressure Table ?

Thanks

Filter the query that feeds the report

Code:
SELECT TOP 1 BloodPressureID, TodayDate, BloodPressure
FROM tblBloodPressure
ORDER BY BloodPressureID DESC;

In the above query BloodPressureID is ordered Descending showing highest number first, then TOP 1 will show the first record only in the query results which should be the last record, make sense?

Change tblBloodPressure to your tables name.
 
Last edited:
Thanks TB,

I have more then one table in my report, do i still use the code you provided, and add the others table, eg:

SELECT TOP 1 BloodPressureID, TodayDate, BloodPressure, feildTable1, ,,,more feilds
FROM tblBloodPressure , tblTables1, tblTable2
ORDER BY BloodPressureID DESC;

??

Thanks again
 
Yes should still work, I am though assuming that BloodPressureID is a record number and therfore the highest number will be the last record created.
 

Users who are viewing this thread

Back
Top Bottom