[AccessD] How to Deal with Time Durations

A.D.Tejpal adtp at touchtelindia.net
Mon Mar 8 13:23:41 CST 2004


Bryan,

    One option could be to store the date as a date field and time as string. Relevant query can include a calculated field depicting the time (in seconds) already lapsed or yet to lapse as compared to the present time (as returned by the Timer function). This affords remarkable flexibility in using the data the way any particular situation might demand.

    If it could be of any help, you could take a look at my sample db named  AppointmentsAlert  at Rogers Access Library (other developers section).

    It features an appointments planner. When put into standby mode, the utility goes into minimized state and keeps scanning the status of scheduled appointments at specified time intervals.

    As & when an event becomes due, an audio alarm is sounded accompanied by a pop-up form displaying the current status of various appointments.

    In the underlying queries, calculated field named MinutesTillSlot should be of interest to you. Related function named Fn_MinutesTillSlot could be modified to return seconds instead of minutes.

Regards,
A.D.Tejpal
--------------
  ----- Original Message ----- 
  From: Bryan Carbonnell 
  To: accessd at databaseadvisors.com 
  Sent: Thursday, March 04, 2004 20:14
  Subject: [AccessD] How to Deal with Time Durations


  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?

  Thanks,

  Bryan Carbonnell
  bryan_carbonnell at cbc.ca
  -- 



More information about the AccessD mailing list