Reputation: 33
How to remove the time from the datetime column in oracle database and save it back with the default time as 00:00:00 without impacting the any date.
for ex: I have a column data type datetime and have thousands of record including date and time as well. I want to keep all the dates as it is and set the time to default as 00:00:00 or remove it completely from all the records in this column. please let me know any query to do so ?
Upvotes: 3
Views: 1221
Reputation: 89661
UPDATE tbl
SET dtcol = TRUNC(dtcol)
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions201.htm
Upvotes: 7