Date Calculations

MANDI201

Registered User.
Local time
Today, 15:18
Joined
Nov 21, 2002
Messages
15
Dates seem to be the bain of my life at the moment

I have to calculate the amount of time that a patient is spending on a ward when they are fit enough to go home. This I managed by using

=Now()-([DATE MEDICALLY FIT])


Now they need to calculate the amount of time they are spending in the bed fit to go home minus the days that they became unwell

I used

=Now()-([DATE MEDICALLY FIT])-[PATIENT UNFIT TO]--[PATIENT UNFIT FROM]

which gives me the correct figure.

The problem is that on reporting the second formula only gives me a figure in the box if the Patient Unfit to and Patient unfit from fields are filled in. Is there a way to tell the computer that I want a date in the box whether these dates have something in them or not!

Thank you for your help.

MANDI:confused: as usual!
 
I think your problem arises from null values. Any arithmetic with a null in fails. Use the Nz function to convert your nulls to something you can handle, like a zero. Look in Access help for stuff on Nz.
 
What dates are you going to put in
[PATIENT UNFIT TO] and [PATIENT UNFIT FROM] if they are Null?
 
These dates are "optional" and will only be filled in if the patient becomes sick during the time that she is on the ward. I still need to record the total days that the patient is on the ward minus any days that they are "unfit".

Should the patient not become "unfit" then these dates will not be used.

Hope this makes sense!

Thanks MANDI
 
=(Date()- [DATE MEDICALLY FIT]) - Nz([PATIENT UNFIT TO] -[PATIENT UNFIT FROM],0)
 

Users who are viewing this thread

Back
Top Bottom