|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
I've get the result by removing the trunc(), since trunc() will truncates time part.
Anyway, thank you very much |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > retrieve records according date time |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|