Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2004, 07:26 PM
tjtee tjtee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 101 tjtee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
how do I filter the time field in oracle

I have a table

Schedule
------------
id int
mydate date
starttime date
endtime date

What I actually required is the mydate (18-Jan-2004), starttime( 05:00 pm), endtime (06:00 pm).

I am storing the data as follow:

mydate 18-Jan-2004 12:00:00 AM
starttime 18-Jan-2004 05:00:00 PM
endtime 18-Jan-2004 06:00:00 PM

Is there a better way to store these information?

Say I current machine time (not the server time) is 04:00 PM and I would like to use this information to find id which starttime is later than 04:00 PM. Should I use to_date or is there a better way to construct the SQL statement?

Thank you.

Reply With Quote
  #2  
Old January 12th, 2004, 09:56 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 44 m 30 sec
Reputation Power: 8
Have you tried using the `interval 'n' ` function?
where current_date > sysdate + interval '4' hour;

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > how do I filter the time field in oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT