Home » SQL & PL/SQL » SQL & PL/SQL » how to insert a date and time field in SQL
how to insert a date and time field in SQL [message #365842] Fri, 18 February 2000 04:18 Go to next message
leo lam
Messages: 3
Registered: February 2000
Junior Member
i can't seem to insert the time into a date field.
i can only insert the date in the format of
'12-nov-1999'

how do you make a SQL insert statement to insert a given time? not just the current time but any time.
Re: how to insert a date and time field in SQL [message #365847 is a reply to message #365842] Sun, 20 February 2000 06:15 Go to previous message
Vine Brownlee
Messages: 1
Registered: February 2000
Junior Member
You need to use the TO_DATE function, which can convert a character expression to a date/time using any format you like. Example:

INSERT INTO mytable (datefield)
VALUES (TO_DATE('2/19/2000 9:30','MM/DD/YYYY HH24:MI'))
Previous Topic: *URGENT** Cursor variables
Next Topic: URGENT!calculation of difference of time.
Goto Forum:
  


Current Time: Fri Apr 19 19:38:43 CDT 2024