0

I have a table in oracle DB that contains data the payment date look like this :

Payment table :
field_date
11.03.2014 00:00:00
20.03.2014 00:00:00

I want to remove time (00:00:00), but stay keep type of data. to do that : 1. I have create new table with name xyz table.

create table xyz (date_1 date)
  1. Insert contains of payment table to xyz table
    insert into xyz select field_date from payment;

or

insert into xyz select trunc(field_date) from payment;

After to do that, field date_1 on xyz table stay contain time. how to do that?

Lalit Kumar B
  • 47,486
  • 13
  • 97
  • 124
flyingbird013
  • 446
  • 2
  • 12
  • 28
  • Oracle DATE data type always contains time part. – Tatiana Nov 16 '15 at 08:41
  • 1
    Oracle does not store dates in the format you see. It stores it internally in 7 bytes with each byte storing different components of the datetime value. If you want to display, use TO_CHAR with proper FORMAT MODEL. While inserting, use TO_DATE with proper FORMAT MODEL. – Lalit Kumar B Nov 16 '15 at 08:51

0 Answers0