Question : date converion in Oracle

Need date format in YYYYMMDD to insert into a table. The following seems to achieve it:
TO_DATE(to_char(sysdate,'YYYYMMDD'), 'YYYYMMDD')
Is there any way to avoid the conversions?

Answer : date converion in Oracle

Dates don't have formats, only the string representations of the dates do

If you mean you want a DATE value with the time component truncated to 00:00:00 then try


TRUNC(sysdate)

you can't remove the time portion of a date,  some strings formats don't display 00:00:00 though
Random Solutions  
 
programming4us programming4us