>Fred,
>
>>You want to try something that will drive you crazy?
>
>Mine was a SQL command that was grouping records by shift int( (t - tFirstShift) / 26400 ) and it was insisting on putting the first 7am record in with the 11pm shift.
Yowsa! Maybe your problem was "crossing midnight" with "t" value (>86400) or was "t" now part of the new day (date+1 t%86400)?