chaitu chaitu
asked on
fetch the records based on specific timings
how to fetch the records from today 04.00 a.m to next day 04:30 a.m. please note that date and time are in separate columns so need to append and fetch the records.
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE ,START_TIM E) values (1,to_date('19-MAY-15','DD -MON-RR'), '12:12:00 pm');
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE ,START_TIM E) values (2,to_date('19-MAY-15','DD -MON-RR'), '6:45:00 pm');
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE ,START_TIM E) values (3,to_date('20-MAY-15','DD -MON-RR'), '06:45:00 am');
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE ,START_TIM E) values (4,to_date('20-MAY-15','DD -MON-RR'), '04:29:33 am');
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE
Insert into EMPLOYEE (EMPLOYEE_ID,EMPLOYEE_DATE
ASKER
'mmddyyyyhh:mi:ss pm'
can if i use am instead of pm?
can if i use am instead of pm?
>> can if i use am instead of pm?
That is just the format mask that tells Oracle how to convert the string into a date.
The documentation for the format masks:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements004.htm#SQLRF00212
The answer to your question is: Yes but am or pm in the mask doesn't affect the actual date values.
That is just the format mask that tells Oracle how to convert the string into a date.
The documentation for the format masks:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements004.htm#SQLRF00212
The answer to your question is: Yes but am or pm in the mask doesn't affect the actual date values.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
If there are issues with the time field, this query will likely error out.