Hi everyone, I have a solution I 'am working on which deals with calculating number of days between two dates. The solution I have working is a jail inmate management system. I order to know the number of days time served, I need to calculation between the two dates. One of my problems is if a person is booked and released on the same date, I need to show this person was in jail for one day even if it was 1 hour or 23 hours and 59 minuets. Also maintain a true calulation of 1 day if 24 hours have passed. Thanks for your help. JM

The problem with your Month_Total_ETS_Date calc is that you are not taking account of the year, hence the calculation fails if the person happens to have been jailed in the same month, regardless of the year, as he/she is released. However, again it seems to me that your calculation is way to complicated. You say "I need to show the number of days an inmate was in our facility for a given month. If he is released on the 10th of the month the result should be 10 days". (I can't quite figure out why you need to know that particular detail, but be that as it may.) If it is a simple as that, why not simply count the number of days the inmate was in prison for that month? I assume that the only circumstance in which the result would be less than the number of days elapsed in the month so far, would be if he/she was jailed within the same month. So a suitable calc would be:

Let ( [

in = TestDates::Intake_Date ;

out = TestDates::Exit_Date ;

today = Get ( CurrentDate ) ;

monthIn = Month ( in ) & Year ( in ) ;

monthOut = Month ( out ) & Year ( out ) ;

monthNow = Month ( today ) & Year ( today ) ;

stillHere = IsEmpty ( out ) ;

daysExitMonth = If ( monthIn = monthOut ; out - in + 1 ; Day ( out ) ) ] ;

daysExitMonth )

Notice I have used the Let ( ) function in both calculations I have suggested, and that this one uses most of the same variables as the first one, then adds some more. I encourage you to study the calcs and learn to use this function; it is one of the most useful tools in the FM kit.