Further explanation
Fatima 512, March 25, 2018 - 6:38 am UTC
Thank you so much for your time and effort.
My current goal is to create a logic that will check for me the expiration of vehicle registration date, so for example
i have a vehicle with the number plate 4774 and assuming that it will expire on the 8th of April (two weeks prior from now), I am facing a problem related to creating such a logic .
i tried this :
SELECT DISTINCT
VEHICLE_NUMBER ,
VEHICLE_TYPE_PARENT,
EXPIRY_DATE
FROM
FM_VEHICLES_REGISTRATION
WHERE
TO_DATE(EXPIRY_DATE,'DD-MM-YYYY') < TO_DATE (SYSDATE,'DD-MM-YYYY') + 14;
March 25, 2018 - 11:28 am UTC
and ?
Divya, June 08, 2020 - 1:33 pm UTC
Thank you so much!
It was really help full.
June 10, 2020 - 1:15 am UTC
glad we could help
A reader, June 10, 2020 - 7:05 am UTC
select TO_DATE (SYSDATE,'DD-MM-YYYY') + 14 from dual;
For me it returns 24-06-0020 :)
June 11, 2020 - 3:23 pm UTC
TO_DATEing a DATE => implicit conversion :(
The database first converts this to a string using your session's NLS settings.
A reader, June 12, 2020 - 7:51 am UTC
Yeah, and this is where I'd prefer exception to be thrown instead of doing to_char/to_date behind the scenes.
June 13, 2020 - 9:45 am UTC
I agree - I would love an init.ora parameter for implicit conversions, eg
implicit_conversion = DEFAULT or ERROR
but can you *imagine* how many apps would immediately break :-)