[AccessD] Calculate Pool Times

Mark A Matte markamatte at hotmail.com
Thu Apr 13 13:46:03 CDT 2006


Hello All,

I need some help with my logic here.  The app will track how long some one 
is on a pool table and charge accordingly.  I want to have the specials 
calculate automatically.  For example:  Someone shoots from 16:00 to 23:00.  
The normal rate is 3dph.  From 17:00 to 19:00 is free and from 20:00 to 
22:00 is 1.5dph.  These are only the specials today...there might only be 
one tomorrow.

I started with a specials table that would have the day,start,end, and rate. 
  Each special is its own record.  In the end it would charge:

16:00-16:59 3$
17:00-18:59 0$
19:00-19:59 3$
20:00-21:59 1.5$
22:00-23:00 3$

I guess I could loop through minute by minute and compare the time to the 
each special... and sum that way...but that didn't seem right?

Any ideas/suggestions on an approach would be greatly appreciated.

Thanks,

Mark A. Matte





More information about the AccessD mailing list