you might want to double check that the connection pool in question has not been blacklisted, I have seen this a number of times where server variables cease to work due to temporary (or permanent) connectivity issues.
You might also want to try it as a session variable.
You are probably having data type issues between dates and timestamps ... but really if you have to do to_number on a to_char on a to_date then subtract 1900000 from it then you've got other issues ... USE of information DRIVES physical data model design. You've got a use for the information, but haven't stored it in such away that it is readily usable. Best = store dates in date dimension and have facts joined on real date keys; Better = have the variable value already converted to the YYYYDDD number format it seems you have your orderdate in ...