AnsweredAssumed Answered

Calculation based on an empty field

Question asked by Bermudianna on Jun 14, 2011
Latest reply on Jun 14, 2011 by philmodjunk


Calculation based on an empty field


I am doing a database for employees.  I have a record for each employee with different information in each layout.  I have one layout for 'sick days'.  I am using calculations based on the start/end of our work day and calculating the # of hours each person is out 'sick' and then calculating how many sick days they have remaining based on their allowed time away (10 days).

At the moment I have it set up so that each person's record has a sick day layout with a repeating field for 'sick day date', 'time out' and 'hours out sick'.

I then have a calculation for 'Sick Days Left' (the number of days they are allowed - the number of days they have taken).

When I do my record, however, it automatically inserts that there is one day out sick when there is no information entered in the 'date' and 'time out' fields.  So I was thinking of doing a calculation in the 'sick days left' to say:

if the field 'Sick Day Date' is empty then the 'Sick Days Left' should read "10", but, if there is something in "Sick Day Date" then the calculation should be "Sick Days Allowed - Sick Days Left".

Is there an easier way of doing this or can someone provide me with the appropriate calculation to use?