Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Millisecs in Oracle
paulspratley_at_yahoo.co.uk wrote:
> Hi All,
>
> How do I add one millisec to a date in Oracle?
>
>
> CREATE TABLE [dbo].[script] (
> [scriptid] numeric(20,0) NOT NULL,
> [creationdate] datetime NOT NULL,
> CONSTRAINT [PK_script] PRIMARY KEY([scriptid])
> )
> GO
>
> INSERT INTO script(scriptid, creationdate)
> VALUES(0, to_date('20060321 12:00:00', 'YYYYMMDD HH:MI:SI')
>
> select creationdate, creationdate + (1/(24*60*60)), creationdate +
> (1/(24*60*60*1000)) from script
>
> The second column adds a second to the creation date and the third
> column should a one millisec to the creation date but it does not seem
> to work.
>
> CREATIONDATE CREATIONDATE+((1/(24*60*60)))
> CREATIONDATE+((1/(24*60*60*1000)))
> ----------------- --------------------------------
> -------------------------------------
> 060321120000+0000 060321120001+0000 060321120000+0000
>
> 060321120000+0000 060321120001+0000 060321120000+0000
>
>
> What am I doing wrong?
> As I'm using Aqua Studio could it be a display setting?
>
OracleŽ Database Concepts, Native Datatypes
"The DATE datatype stores point-in-time values (dates and times) in a table. The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds (after midnight)."
robert Received on Fri Mar 24 2006 - 03:34:04 CST