Re: How to store 'time' values?? Date field?

From: <>
Date: Mon, 02 Aug 1999 13:57:38 GMT
Message-ID: <7o484d$k8a$>

[Quoted] In article <37a58145.67228329_at_Oracle8>, wrote:
> >I will also have to store the standard times at which
> > different employees
> >should come in. (i.e. factory staff at 8:00, office staff
> >at 9:00, computer people at 11:00 ( :-) )
> >and so on. Then compare the times at which people
> >come in with these standard times.

Actually, here is what I've found to be the most challenging part of using times: How do I just store a time, that has no logical date component??? If you know that it will always be on the hour, then I guess it could be a number(2) with a check constraint to ensure 0 <= hour <= 23.

In the past, I've had a varchar2(4) column, with check constraints to ensure the hour (substr(time,1,2)) is proper and the minutes (substr (time,3,2)) is proper. However, it must get converted to a numerical portion of a day anytime I need to use it in cojunction with a date.

I am certainly interested in any other approaches to this issue, that I have missed....

> Not to mention that I should insert 8:59 am every time
> my own empno comes
> up, no matter what time it is. ;-)

Now that's what I call detailed requirements definition....


Sent via
Share what you know. Learn what you don't. Received on Mon Aug 02 1999 - 15:57:38 CEST

Original text of this message