I want to count patient days within a month. I have solution reached on 04/19/02 on this bulleting board, this is less cumbersome. Excel Formula: =IF(OR(C12>$AL$3,D12<$AL$2),"",IF(AND(C12>=$AL$2,D12<=$AL$3),D12-C12,IF(AND(C12>=$AL$2,D12>=$AL$3),$AL$3-C12,IF(AND(C12<$AL$2,D12>$AL$3),$AL$3-$AL$2+1,D12-$ AL$2+1)))) Note: Absolute cell references are First day and last day of month, other cell references are admit date and discharge date. I tried using the Expression builder and continually received syntax errors. Please help convert this to an access formula, this is what didn’t work in Access:
=Iif(Or( [Admit Date] >04/01/02, [DischargeDate] <04/30/02), " ", Iif(And( [Admit Date] >=04/01/02, [DischargeDate] <=04/30/02), [DischargeDate] - [Admit Date] , Iif(And( [Admit Date] >=04/01/02, [DischargeDate] >=04/30/02,04/30/02- [Admit Date] ,Iif(And( [Admit Date] <04/01/02, [DischargeDate] > 04/30/02).04/30/02-04/01/02+1, [DischargeDate] -04/01/02+1))))
Any help is greatly appreciated!
=Iif(Or( [Admit Date] >04/01/02, [DischargeDate] <04/30/02), " ", Iif(And( [Admit Date] >=04/01/02, [DischargeDate] <=04/30/02), [DischargeDate] - [Admit Date] , Iif(And( [Admit Date] >=04/01/02, [DischargeDate] >=04/30/02,04/30/02- [Admit Date] ,Iif(And( [Admit Date] <04/01/02, [DischargeDate] > 04/30/02).04/30/02-04/01/02+1, [DischargeDate] -04/01/02+1))))
Any help is greatly appreciated!