Re: SQL - Updating time, HOW?
Date: Tue, 10 Nov 1998 09:43:43 -0800
Message-ID: <36487B4F.770AE46A_at_cat.e-mail.NOSPAM.com>
Azman,
Here's how to update strictly
the time element of a date field:
UPDATE
MYTIME
SET
MASA = TO_DATE('01:03', 'HH24:MI')
WHERE
....
To update both date and time:
SET
MASA = TO_DATE('04-MAR-99 01:03', 'DD-MON-YY HH24:MI')
-- Shawn
====================
azhan98_at_tm.net.my wrote:
I have insert a data into a table with a field datatype of DATE.Received on Tue Nov 10 1998 - 18:43:43 CETSQL> INSERT INTO MYTIME(MASA)
2 VALUES('04-MAR-99')
3 ;When I select the data using TO_CHAR, I can see the time for that rows.
SQL> SELECT TO_CHAR(MASA,'DD-MON-YY HH:MI:SS') FROM MYTIME;
TO_CHAR(MASA,'DD-MON-YYHH:MI:SS')
---------------------------------------------------------------------------
01-MAR-99 12:00:00
02-MAR-99 12:00:00
04-MAR-99 12:00:00However, I have a problem in updating the row value for both date and time.
What SQL update command should I type if I want to update the time for
04-MAR-99 from 04-MAR-99 12:00:00 to become 04-MAR-99 01:03:00Thanks for your help.
Azman
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own