Time Frame Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need a way to tell if cases have been completed by 90 days of the start
date. I will also need other time frames such as did the infant receive
screening by 1 month of age, and/or follow-up by 6 months of age.

I have the dates, I just need a way to query them out into time frames to
make sure the work was done on time.

Any suggestions? If so, please be detailed and specific, this is my first
real database.

Thanks.
 
If you are hoping for detail and specificity in reply you will need to
provide some of your own. The place to start is with a plain-language
description of just what you need to do.
 
I have cases on newborns that are opened on a daily basis. I track the
infant's date of birth, when the case was opened, when the case was closed,
and what was done when.

What I need is a way to say from these infants date of birth, did they
receive follow-up within 1 month of being born. And.. did they receive
treatment within 3 months from being born.

I have to make sure that most work is done before the infant is of a certain
age., so I would like to pull a query from the date of birth to say.. yes
this was done by 1 month of age.

Please let me know what information would be helpful to you.

Thanks.
 
To compute Age at a specific point in time, use

DateDiff("yyyy", DOB, SpecificDate) - _
IIf(Format(SpecificDate, "mmdd") < Format(DOB, "mmdd"), 1, 0)

Since you need the age in months , not years, use

DateDiff("m", DOB, SpecificDate) - _
IIf(Format(SpecificDate, "dd") < Format(DOB, "dd"), 1, 0)
 
Thanks, but I'm not sure what to do with that information. Where does it go
and where do I tell it that I want it to be of a time frame of 1 month?
 
Ok... I have a Follow-up table with fields such as infant date of birth,
infant screen date, date referred for follow-up, and date case completed. I
want to pull various reports such as the number of infant screens done on or
within 1 month from the date of birth.

I also need to see the amount of cases that are completed within 3 months of
the date referred. These are all random dates.

Thanks.
 
I see you needing at least three tables --
Infant--
InfantID - autonumber - primary key
MotherID - number - interger - related to PatientID in Patient table.
Birth - DateTime
Sex - text
BirthWT - number - single
Lenght - number - single

FollowUP--
InfantID - number - interger - related to Infant table
ScreenDate - DateTime
FollowUpType - number - interger - related to FollowUpType table - 1, 3, 6
month
Next - DateTime - for out of normal schedule sequence - other than 1, 3, 6
month
WT - number - single
Lenght - number - single
Comments – memo

FollowUpType—
TypeID – autonumber
Description – text - 1, 3, 6 month – DPT, XYZ, Illness, Illness return,
Non-specific

TypeID Description DaysFromBirth
1 1 month 30
2 3 month 90
3 6 month 186
4 DPT 45
5 XYZ 90
6 Illness
7 Illness return
8 Non-specific
Add as necessary.

SELECT Infant.InfantID,
IIf(DateDiff("d",[Birth],[ScreenDate])<[DaysFromBirth],"Yes","No") AS [On
Time], FollowUpType.Description
FROM Infant INNER JOIN (FollowUpType INNER JOIN FollowUP ON
FollowUpType.TypeID = FollowUP.FollowUpType) ON Infant.InfantID =
FollowUP.InfantID
WHERE (((FollowUpType.DaysFromBirth)>0 Or (FollowUpType.DaysFromBirth) Is
Not Null))
ORDER BY Infant.InfantID;

I hope this helps.
 
Back
Top