0
I have a column called 'periodo_filter' with date of type (data1 A data2), example: (01/1/2000 A 19/1/2020). With the following code I am removing the first date from this column and creating a new table with it:
CREATE TABLE MINHA_TABELA_NOVA AS (SELECT
TO_DATE(TRIM(SUBSTR(periodo_filtro, 1,
INSTR(periodo_filtro, ' ', 1, 1))), 'dd/mm/yyyy') periodo_inicial
FROM
MINHA_TABELA);
put the result is as follows:
How do I get this timestamp (12:00:00) removed from this column? I want to keep only the date information
Convert to char again and leave in the format you need, for example
SELECT TO_CHAR(TO_DATE('13/07/2021','DD/MM/YYYY'),'DD/MM/YYYY') DATA FROM DUAL
– Ricardo Pontual
worked perfectly, but I just realized that I would need this data on date type, for future manipulations. There is another alternative?
– Pirategull
the date type tracks the time, even if q is a "00:00:00", I suggest to keep it that way and switch to the format you want when showing the value
– Ricardo Pontual
I understand! I will follow this way. Thanks for the answers
– Pirategull