0

I want all records which exist than particular date timestamp and the table create_datetime column.

When this query is run, it should provide all the records for the day greater than create_datetime with a particular 18:00:00

Blachshma
  • 17,097
  • 4
  • 58
  • 72
Dev_Off
  • 55
  • 1
  • 9
  • Can you provide example table definition with some test data input and your expected output? – mvp Jan 07 '13 at 06:36
  • 1
    `select * from table where create_date_time > to_date('date_here'||18:00:00, 'dd-mon-yyyy hh24:mi:ss';` where `date_here` is your input date in format `dd-mon-yyyy`. This question is basic. – Florin Ghita Jan 07 '13 at 07:03

1 Answers1

0

Your question text is a bit chopped up but what I think is you want every record where the time element of the create_date is after 18:00. If so, this query will get that. It uses the date format mask SSSSS which returns date as the number of seconds after midnight.

select * from your_table
where to_number(to_char(create_date, 'SSSSS')) >= (18 * (60*60))
and some_other_date >= trunc(sysdate)

The other part of that query is a wild guess, because like I said, your question has been lost in translation. I have plumped for "records where some other date column has been set to today's date".

APC
  • 144,005
  • 19
  • 170
  • 281