Gustav Brock
gustav at cactus.dk
Thu Mar 4 09:19:09 CST 2004
Hi Bryan > In a new app that I am creating, of which you will probably hear ALL > about it over the next few weeks :), I have to keep track of event > durations. > Right now I have a field for the start time, and one for the duration. > Both are Date/Time fields. > The durations for the event can last from 1 second all the way up to > many hours, and possibly even days. > Should I actually be storing the start and end time and calculating the > duration? > The duration can be entered as either the actual duration or the actual > end time. > If you have done something like this, how have you handled it? That certainly depends. If you find it important or will have to use later the actual points in time, store the start and end times as full date/time values. If the durations are important, store these as hours (with decimals), minutes or seconds as to your needs. Also, how will these duration be input? By users? Often or seldom? Will input have to be validated? Against what? My best advice is to use the built in date/time functions and never fall back to "smart" methods as you will be bitten sooner or later or loose flexibility. Look up the archive on threads on this; there are several even some recent. /gustav