Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to update a Date Field?
On 10 Dec 98 17:35:56 GMT, dolans_at_stripe.Colorado.EDU (Sean
Dolan) wrote:
> Somehow in my database table, I have a date field that only has the format '02-NOV-98'. I would like to do an update statement that appends the date with 12:00 PM. I have tried and tried and cannot get the date to accept the hour of time. How do you do it?
I believe one solution is as follows:
update your_table set date_col = trunc(date_col) + 12;
You can verify the update by issueing:
select to_char(date_col,'dd-mon-yyyy hh:mi') from your_table;
By the way, your dates only _appear_ to to have the format '02-Nov-98'. Internally, they are stored quite differently. Use TO_CHAR (see the previous select) to control the display format.
regards,
Jonathan Received on Sat Dec 12 1998 - 18:18:47 CST