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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 21st, 2004, 10:21 PM
weebeng weebeng is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 76 weebeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 22 sec
Reputation Power: 5
retrieve records according date time

hi..i got question here.Hope that somebody can help me...
Table A has field called ac_datetime(date data type). It stores the transactions datetime values in that field.
I'd like to retrieve the records that is before '21-02-2004 11:30:00'.
Code:
select * from A where trunc(ac_datetime) < to_date('21-02-2004 11:30:00', 'dd-mm-yyyy hh24:mi:ss');

The above sql returns no record. But i have records in table A.
What is the sql command?I'm using the oracle db.
Thank you!

Last edited by weebeng : February 21st, 2004 at 10:45 PM.

Reply With Quote
  #2  
Old February 22nd, 2004, 09:29 PM
Dan Drillich Dan Drillich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 68 Dan Drillich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
The SQL code looks just fine. Are you sure the ac_datetime column holds non-null values? If so, can you please give us the output of:
select ac_datetime from A
where rownum<10;

Regards,
Dan

Reply With Quote
  #3  
Old February 23rd, 2004, 01:58 AM
weebeng weebeng is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 76 weebeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 22 sec
Reputation Power: 5
I've get the result by removing the trunc(), since trunc() will truncates time part.
Anyway, thank you very much

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > retrieve records according date time


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 2 hosted by Hostway