|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Query Help
I need help with a query in Oracle. I want to
pull all the records from a table between certain times of the day (24 hour period) for reporting. For example: Monday, 12:00 am to Tuesday, 12:00 am Example record: Start_Time 6/17/2004 11:33:19 AM End_Time 6/18/2004 11:35:30 PM Here is what I have: Code:
select * from table
where
START_TIME <= to_date('','')
and
END_TIME > to_date('','')
I am not sure exactly how to arrange my SQL to make this work, being I am pretty new to the Oracle world. I "think" you would have to use the to_date function. Can anyone help me? Thanks In Advance |
|
#2
|
|||
|
|||
|
The syntax of to_date function is:
to_date(date,date_format) here, date could be any date variable or string date_format in defines the format of date in character. currently there are so many format are available, for complete information please read the documentation. example: SELECT (sysdate,'Month dd, YYYY HH24:MI:SS') FROM dual / or SELECT * FROM emp WHERE hiredate BETWEEN to_date('01-JAN-2004 10:00 A.M','DD-MON-YYYY HH:MI A.M') AND to_date('31-MAY-2004 2:00 P.M','DD-MON-YYYY HH:MI P.M') FROM dual / |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Query Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|