I am having the same issue except my MM and DD are coming backwards when I use Visual Studio, so in a CVS export to Excel, the dates error if the Month is over 12 (because it's pulling day data), and then it reads backwards other dates, such as May 1st changed to Jan 5th.
I entered the Alter Session as the first line of my script with the SQL query starting with Select as the next line. I don't know a lot and am mostly self-taught, so if I am not putting that in the correct place, please help.
I have a query that runs, but when I add that first line (I have tried several ways to format the actual date format, including different separators and single vs double quotes, which I know is more of a Python thing) . Where do I add that command or what will fix this issue?
ALTER SESSION SET nls_date_format= 'MM-DD-YYYY'
SELECT
p.id_number,
I got this error
Error report -
ORA-00922: missing or invalid option
https://docs.oracle.com/error-help/db/ora-00922/
00922. 00000 - "missing or invalid option"
*Cause: An invalid option was specified in defining a column or
storage clause. The valid option in specifying a column was NOT
NULL to specify that the column cannot contain any NULL
values. Only constraints may follow the datatype. Specifying a
maximum length on a DATE or LONG datatype also causes this
error.
*Action: Correct the syntax. Remove the erroneous option or
length specification from the column or storage specification.