Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.paradox    |    To crash or not to crash, asks Borland    |    9,834 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 8,899 of 9,834    |
|    Larry DiGiovanni to Craig    |
|    Re: How to set up a table    |
|    09 Nov 07 15:09:49    |
      From: nospam@nospam              Craig wrote:              > The problem in hospitals is that the day starts @0700.              Time of day is just an expression of elapsed time past an arbitrary start.       Instead of actual time of day, store the time as an integer offset from the       start of your workday in units to whatever granularity you need - minutes,       seconds, etc.              For minute granularity, you'd have 0700=0, 0715=15, 0730=30,...,0900=120,       0915=135,...,0600=1380, 0630=1395, 0659=1439              The same way of thinking works without an offset. 0700=420,       0715=435,...,0600=1740, 0659=1759                     You have to translate this in and out during data entry, reporting, etc.       The simple way is to establish these values (using whichever scale you want)       as the PK in a lookup, then associate with the actual time of day. Then       rendering in a UI is a simple join or a backtrack.              I've used this approach several times, mostly regarding a broadcast       schedule, where the broadcast day starts and ends after midnight. Before       long it becomes automatic, and you start thinking in terms of offsets       instead of TOD.              --       Larry DiGiovanni              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca