ttStart=10/03/2003 09:20:00 && DateTime memvar ttEnd =10/03/2003 10:00:00 && DateTime memvar lnSeconds = ttend-ttstart && Ruturns 2399 in program instead of 2400I put these values in a command window, and subtract the datetime fields I get 2400. This same case, I can put other time values in and it works perfect. Not sure where to start looking to figure out what I'm doing wrong. Set('seconds')=ON and hours are set to 24. I've watched it all the way until this function is called, and it shows 2400, as soon as it gets here, ttstart-ttend=2399
* This line calls the the function lcResults=ctCalcTimeCharges(thisform.Enteror,thisform.ExitOR,lnPrimary,lnSecondary,lnBegins,lnRepeats)
* Program: ctCalTimeCharges PARAMETERS ttStart,ttEnd,tiPrimeID,tiSecID,tiBegins,tiRepeats LOCAL lcReturn,lnTotalSecs,lnPriCnt,lnSecCnt lnTotalSecs=INT(ttEnd-ttStart) lnPrimeMinutes=tiBegins lnPrimeSecs=tiBegins*60 lnPriCnt=1 IF lnPrimeSecs > lnTotalSecs lnPrimeSecs=lnTotalSecs lnPrimeMinutes=INT(lnPrimeSecs / 60) lnPriCnt=1 lnSecCnt=0 lnSecMinutes=0 ELSE * SET STEP ON lnSecSecs=INT(lnTotalSecs-lnPrimeSecs) lnSecCnt=INT(lnSecSecs/60)/tiRepeats lnIntVersion=INT((lnSecSecs/60)/tiRepeats) * See if we need to add an addition IF lnSecCnt > lnIntVersion *lnSecCnt=lnSecCnt+1 lnSecCnt=lnIntVersion+1 ENDIF ENDIF lcReturn=[|]+ALLTRIM(STR(lnPriCnt))+[|]+ALLTRIM(STR(lnSecCnt))+[|] RETURN (lcReturn)