Counting Days

Liz H

Registered User.
Local time
Today, 03:50
Joined
Apr 18, 2002
Messages
10
Goal: Count of Patient days in a month Feb. by patient account

Conditions:
admit >02/01/02 and discharge >02/28/02, then 02/28/02-admit
admit >02/01/02 and discharge <02/28/02, then discharge -admit
admit< 02/01/02 and discharge >02/28/02, then 02/28/02-02/01/02
admit < 02/01/02 and discharge <02/28/02, then discharge - 02/01/02

My problem in MSAccess is I have more than just a true and a false, also it doesn't recognize the 2nd part of my condition.
I am thinking I may have to do 4 expressions and the true condition gives a number and the false gives null but I could still then get accurate totals. However, written like below it gives me all false even when true
Expr1: IIf([DischargeDate]<2/28/2002 And [Admit Date]<2/1/2002,[DischargeDate]-[Admit Date],Null)

When I reversed just to show it saying all false. I have the expression saved like this it the table I am sending you . I appreciate your help!!
Expr1: IIf([DischargeDate]<2/28/2002 And [Admit Date]<2/1/2002,Null,[DischargeDate]-[Admit Date])
 
How about breaking it into 2 bits working out beginning and end:

DaysIn: Iif(Discharge>02/28/02,02/28/02,Discharge) - Iif(admit<02/01/02,02/01/02,admit)

HTH
 
Thanks, Harry -- I think I am having a date format problem because that should work and it's not. I am using the excel solution given to Joey on his question. I would love to apply the code -- it's just over my head. I have a very functional DB but I have to use the expression builder and other built-ins with my limited abilities. I am so happy to have discovered this sight. Ya'll are great!
 

Users who are viewing this thread

Back
Top Bottom