Hi,
For the daycare time in hours try:
DaycareHours:
DateDiff("n",TimeSerial(Hour([TimeIn]),((Minute([TimeIn])+7.5)\15)*15,0),TimeSerial(Hour([TimeOut]),((Minute([TimeOut])+7.5)\15)*15,0))/60-4
For minutes try:
DaycareMinutes:
DateDiff("n",TimeSerial(Hour([TimeIn]),((Minute([TimeIn])+7.5)\15)*15,0),TimeSerial(Hour([TimeOut]),((Minute([TimeOut])+7.5)\15)*15,0))-4*60
Clifford Bass
"Difficult1" wrote:
> Good morning. I am in the process of designing an Access database that will
> track in/out times. It is sort of a special circumstance calculation that I
> need. What I am looking for is a formula (or some sort of code) that will
> allow me to calculate the difference between times, with some specific "ifs"
> involved. First off, I want to enter TimeIn and TimeOut (whatever their names
> would be) and have each of them rounded to the nearest quarter hour (ie
> 7:38AM would be 7:45 rounded). Then, I need to take anything between 7:30 and
> 8:00 (both AM) and calculate the amount of time there. Then, I need to take
> 12noon (absolute) and the end time (again, rounded to the nearest quarter
> hour) and calculate that amount of time. I then need to add the results to
> get the total time between those hours.
>
> Anybody got suggestions? I know it is pretty particular. This is to
> calculate time for daycare services before school (7:30-8) and after school
> (12PM-3:30PM).
> Any help would be greatly appreciated. I have tried a couple of different
> things that seem way to complex to be right, although most of it works out, I
> cannot simply add the AM total and the PM totals together to get the grand
> total.
|