Good Morning,
I have a particular query (below) that executes successfully in certain sessions within SQL Developer, but not others. In the other sessions, an 'Invalid Number' error returns, unless one of the 'TRUNC' conditions is removed (only the TRUNC). Unfortunately, the only thing I can guess is the particular date/time settings associated with the user's SQL Developers session do not support the formats associated below, which I realize is a long shot. The current setting for the date format is 'DD-MON-YY HH:mm:ss AM'. Could the TO_CHAR '24HH' statement be causing the issue? I wanted to get some thoughts from some experts and determine if an NLS_DATE_FORMAT is really required here (especially since it executes elsewhere) or if there is a particular setting (date/time format) that can be utilized?
SELECT
TO_CHAR(DATE_1, 'YYYY-MM-DD') FIELD_1,
TO_CHAR(DATE_1, 'HH24:MI:SS') FIELD_2
FROM
TABLE_1
AND FIELD_1 >= TRUNC(SYSDATE)-1
AND FIELD_1 < TRUNC(SYSDATE)
Thanks in advance for any help!