Dan Waters
dwaters at usinternet.com
Thu Apr 13 14:08:51 CDT 2006
Hi Mark, I just finished a weekend days count function, and what you're doing is very similar, and your approach is fine. You max loop size is 24. You can look up 'Count Weekend Days' in the AccessD archive. There you will find Drew Wutka's magic code. And - make a separate form to be able to manage your rates (which should be in a lookup table), and I think it will work well. Your lookup table should have 24 rows, assuming you will always change rates on the hour. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Thursday, April 13, 2006 1:46 PM To: accessd at databaseadvisors.com Subject: [AccessD] Calculate Pool Times 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com