Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

check constant timestamp value against the column and see if it is greater or less than

Raj ThadakaJun 20 2023

Hi All,

Thank yo so much for your time. I have this scenario where i get the ETL loaddate and I convert it into EST - this is accomplished - no issue using the below

CAST(FROM_TZ(CAST(ETLLOAD.ETL_LOAD_DATE AS TIMESTAMP), 'UTC') at time zone 'America/New_York' AS Date) AS ETL_LOAD_DATE_EST

output of the above - each record will have a value that is either same or different by a min or 2 otherwise most of them will have the same value -

6/20/2023 12:30:29 PM

6/20/2023 12:31:38 PM

What is the next step that I need from the above is

  1. take the date part i.e 6/20/2023 add a constant timestamp which is 06:30:00 AM and also 09:30:00 AM
  2. then check if the value above is greater than 630 AM or greater than 930 AM then flag as 1 if it is greater or flag as 0 if it is not
  3. is it ok to do this is another new column - yes, using the above converted into est - use another new column - fine

6/20/2023 12:30:29 PM > 6/20/2023 06:30:00 AM or 6/20/2023 12:30:29 PM > 6/20/2023 09:30:00 AM

any suggestions - thanks a lot for your time

Comments
Post Details
Added on Jun 20 2023
7 comments
1,804 views