List of records >10 days old

L

Linda RQ

Hi Everyone,

I am using Access 2003. I want a list of patients who are active and have
been on therapy >10 days as well as a field that shows how many days they
have been on therapy. I have a tblPatients and a tblTherapy with the fields
I need. I created a query joining these 2 tables and only showing active
patients with LastName, FirstName, AdmNum and their ThpyStDtTm. The active
field is Y/N in my tblPatients. Once I get only the records >10 days old, I
need another field that gives me the total days the patient has been here.

Thanks,
Linda
 
J

John W. Vinson

Hi Everyone,

I am using Access 2003. I want a list of patients who are active and have
been on therapy >10 days as well as a field that shows how many days they
have been on therapy. I have a tblPatients and a tblTherapy with the fields
I need. I created a query joining these 2 tables and only showing active
patients with LastName, FirstName, AdmNum and their ThpyStDtTm. The active
field is Y/N in my tblPatients. Once I get only the records >10 days old, I
need another field that gives me the total days the patient has been here.

Thanks,
Linda

I presume you have an AdmitDate or some such field?

If so, you can use a criterion

<= DateAdd("d", -10, Date())

on that field to find only records where the AdmitDate is ten days or more in
the past. Also add a calculated field by typing

DaysInTherapy: DateDiff("d", [AdmitDate], Date())

in a vacant Field cell. Use your actual date field's name in place of
AdmitDate of course, and change DaysInTherapy to whatever fieldname you would
like.
 
L

Linda RQ

John W. Vinson said:
Hi Everyone,

I am using Access 2003. I want a list of patients who are active and have
been on therapy >10 days as well as a field that shows how many days they
have been on therapy. I have a tblPatients and a tblTherapy with the
fields
I need. I created a query joining these 2 tables and only showing active
patients with LastName, FirstName, AdmNum and their ThpyStDtTm. The
active
field is Y/N in my tblPatients. Once I get only the records >10 days old,
I
need another field that gives me the total days the patient has been here.

Thanks,
Linda

I presume you have an AdmitDate or some such field?

If so, you can use a criterion

<= DateAdd("d", -10, Date())

on that field to find only records where the AdmitDate is ten days or more
in
the past. Also add a calculated field by typing

DaysInTherapy: DateDiff("d", [AdmitDate], Date())

in a vacant Field cell. Use your actual date field's name in place of
AdmitDate of course, and change DaysInTherapy to whatever fieldname you
would
like.

Hi John,

I do have an admit date but that is not added until after the patient is
discharged and we are only looking at patients who are still in the hospital
and on our services > 10 days. I'll try this tomorrow when I get back to
work.

Thanks,
Linda
 
J

John W. Vinson

I do have an admit date but that is not added until after the patient is
discharged and we are only looking at patients who are still in the hospital
and on our services > 10 days. I'll try this tomorrow when I get back to
work.

Do you have - somewhere! - the starting date that you want to calculate from?
If not, you're up the creek!
 
L

Linda RQ

John W. Vinson said:
Do you have - somewhere! - the starting date that you want to calculate
from?
If not, you're up the creek!


Oh yea...no worries, ThpyStDtTm = therapy start date and time. That is
what we want to see, any patient who is on therapy more than 10 days. I
think I can plug the right thing in to the right place. I'll let you know
sometime tomorrow.
 
L

Linda RQ

John W. Vinson said:
Hi Everyone,

I am using Access 2003. I want a list of patients who are active and have
been on therapy >10 days as well as a field that shows how many days they
have been on therapy. I have a tblPatients and a tblTherapy with the
fields
I need. I created a query joining these 2 tables and only showing active
patients with LastName, FirstName, AdmNum and their ThpyStDtTm. The
active
field is Y/N in my tblPatients. Once I get only the records >10 days old,
I
need another field that gives me the total days the patient has been here.

Thanks,
Linda

I presume you have an AdmitDate or some such field?

If so, you can use a criterion

<= DateAdd("d", -10, Date())

on that field to find only records where the AdmitDate is ten days or more
in
the past. Also add a calculated field by typing

DaysInTherapy: DateDiff("d", [AdmitDate], Date())

in a vacant Field cell. Use your actual date field's name in place of
AdmitDate of course, and change DaysInTherapy to whatever fieldname you
would
like.


Worked Great!! Thank-you.
 

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