Help with Listing last 4 records

K

Kasa

Hi,
I am working with a report that requires the last 4 blood pressures of a
patient to be listed. Example:

MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
123 2/11/2009 128/80
123 2/1/2009 128/79

I'm having trouble trying to figure out how to list the last 4 blood
pressures (based on date) for MR#123.
Thanks!
 
J

Jeff Boyce

Kasa

Create a new query, pointed at that table.

Add your [MedRec#], [DateTaken], and [BloodPressure] fields.

Use your 123 as selection criterion for the [MedRec#].

Sort by [DateTaken], Descending. This gives you the most recent first.

Display BP.

Change the properties of the query to use the TOP 4.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

Kasa

Hi again,
Thanks for the help. I also should have added this as well: in this
report there are multiple medical records. So i'm trying to figure out how
to list the last 4 records for each medical record number. Here's what I
would need for the final output:
MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
456 2/1/2009 140/82
456 1/23/2009 140/90
456 1/20/2009 150/80
456 1/5/2009 150/90

Can I do a count for the MR# then in another query list the 4 records?
Sorry if this is a repeat...I submitted a reply earlier but didn't see it
was posted.
Thanks again in advance!

Jeff Boyce said:
Kasa

Create a new query, pointed at that table.

Add your [MedRec#], [DateTaken], and [BloodPressure] fields.

Use your 123 as selection criterion for the [MedRec#].

Sort by [DateTaken], Descending. This gives you the most recent first.

Display BP.

Change the properties of the query to use the TOP 4.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Kasa said:
Hi,
I am working with a report that requires the last 4 blood pressures of a
patient to be listed. Example:

MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
123 2/11/2009 128/80
123 2/1/2009 128/79

I'm having trouble trying to figure out how to list the last 4 blood
pressures (based on date) for MR#123.
Thanks!


.
 
J

Jeff Boyce

Kasa

A quick search online reveals this link for "Top N Values per Group":

http://support.microsoft.com/kb/210039

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Kasa said:
Hi again,
Thanks for the help. I also should have added this as well: in this
report there are multiple medical records. So i'm trying to figure out
how
to list the last 4 records for each medical record number. Here's what I
would need for the final output:
MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
456 2/1/2009 140/82
456 1/23/2009 140/90
456 1/20/2009 150/80
456 1/5/2009 150/90

Can I do a count for the MR# then in another query list the 4 records?
Sorry if this is a repeat...I submitted a reply earlier but didn't see it
was posted.
Thanks again in advance!

Jeff Boyce said:
Kasa

Create a new query, pointed at that table.

Add your [MedRec#], [DateTaken], and [BloodPressure] fields.

Use your 123 as selection criterion for the [MedRec#].

Sort by [DateTaken], Descending. This gives you the most recent first.

Display BP.

Change the properties of the query to use the TOP 4.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Kasa said:
Hi,
I am working with a report that requires the last 4 blood pressures of
a
patient to be listed. Example:

MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
123 2/11/2009 128/80
123 2/1/2009 128/79

I'm having trouble trying to figure out how to list the last 4 blood
pressures (based on date) for MR#123.
Thanks!


.
 
K

Kasa

Thanks Jeff so much for it help...it finally worked!!!

Jeff Boyce said:
Kasa

A quick search online reveals this link for "Top N Values per Group":

http://support.microsoft.com/kb/210039

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Kasa said:
Hi again,
Thanks for the help. I also should have added this as well: in this
report there are multiple medical records. So i'm trying to figure out
how
to list the last 4 records for each medical record number. Here's what I
would need for the final output:
MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
456 2/1/2009 140/82
456 1/23/2009 140/90
456 1/20/2009 150/80
456 1/5/2009 150/90

Can I do a count for the MR# then in another query list the 4 records?
Sorry if this is a repeat...I submitted a reply earlier but didn't see it
was posted.
Thanks again in advance!

Jeff Boyce said:
Kasa

Create a new query, pointed at that table.

Add your [MedRec#], [DateTaken], and [BloodPressure] fields.

Use your 123 as selection criterion for the [MedRec#].

Sort by [DateTaken], Descending. This gives you the most recent first.

Display BP.

Change the properties of the query to use the TOP 4.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

Hi,
I am working with a report that requires the last 4 blood pressures of
a
patient to be listed. Example:

MedRec# Dates of Blood Pressure Blood Pressure
123 4/23/2009 130/80
123 4/2/2009 130/80
123 3/24/2009 130/79
123 3/1/2009 130/82
123 2/11/2009 128/80
123 2/1/2009 128/79

I'm having trouble trying to figure out how to list the last 4 blood
pressures (based on date) for MR#123.
Thanks!




.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top