Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

ISO 8601 date format issue

mist123Apr 1 2024 — edited Apr 1 2024

Hi,

Oracle 11.2

transaction_date column is a DATE datatype and i want to use as a paramter in the where clause

transaction_date=2024-01-08T19:58:18.000+00:00 and passing date through calendar and the format is same.

select 1111 transaction_id,'2024-01-08T19:58:18.000+00:00' transaction_date from dual
union all
select 2222 transaction_id,'2023-01-08T19:58:18.000+00:00' transaction_date from dual
union all
select 1111 transaction_id,'2024-03-31T19:58:18.000+00:00' transaction_date from dual
union all
select 1111 transaction_id,'2024-03-27T19:58:18.000+00:00' transaction_date from dual

I want to add filter and dates from 01-MAR-2024 to 31-MAR-2024 and get between these records.

I used to_char(transaction_date,'DD-MON-YYYY')=:p_date1 but it is not giving given dates records and it is giving all the records.

I tried many ways but got date format errors.

Comments
Post Details
Added on Apr 1 2024
4 comments
92 views