Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 14th, 2004, 07:30 PM
zxmax zxmax is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 14 zxmax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question display only the last record

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

Reply With Quote
  #2  
Old March 15th, 2004, 02:07 AM
Stev Stev is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Queensland, Australia
Posts: 256 Stev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 53 sec
Reputation Power: 6
Change the recordsource for your report to a query and select the top record only. A sample SQL statement...

SELECT TOP 1 BPReadings.PatientID, BPReadings.BloodPressureID, BPReadings.TodayDate, BPReadings.BloodPressure
FROM BPReadings
ORDER BY BPReadings.PatientID, BPReadings.BloodPressureID DESC;

Look up "Show only the high or low values in a query" in the help files for more details.

Reply With Quote
  #3  
Old March 15th, 2004, 11:10 AM
zxmax zxmax is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 14 zxmax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Thanks for the reply,

My confusion is, i have more then one table in my report, so my sql statement keep giving me worng syntex, here is a sample of what i 've done

eg:

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

Any clues, ??
Thanks again

Reply With Quote
  #4  
Old March 15th, 2004, 11:36 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
I believe that to you the top syntax you need to specify how the tables are joined.

Create you query using the query design builder

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > display only the last record


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT