Home » Developer & Programmer » Forms » Problem Inserting Date Time
Problem Inserting Date Time [message #84693] Sat, 17 April 2004 23:06 Go to next message
Krshanu
Messages: 10
Registered: September 2002
Junior Member
Hi,

I am trying to insert into a Date column.I am taking one Char in 'dd/mm/yyyy' form from one field and another Char in 'hh24:mi' form from another.I am Concating them , so that the concatenated_string is '18/04/2004 12:38'

Then I am assigning it to the Date column in Pre Insert Trigger

Date_Field :=
To_Date(concatenated_String,'dd/mm/yyyy hh24:mi')

But In Database it is going as '18/04/2004 00:00'
instead of '18/04/2004 12:38'.

Can anybody Help.

Thanks in Advance
Krishanu
Re: Problem Inserting Date Time [message #84716 is a reply to message #84693] Tue, 20 April 2004 06:30 Go to previous messageGo to next message
jan
Messages: 71
Registered: August 2002
Member
Please check if you are by any chance using the trunc function.

ie. trunc(Date_Field) while inserting.

SELECT to_char(sysdate,'dd/mm/yyyy HH24:mi') Dt1,
to_char(trunc(sysdate),'dd/mm/yyyy HH24:mi') Dt2
FROM dual

dt1 dt2
20/04/2004 10:34 20/04/2004 00:00

Jan
Re: Problem Inserting Date Time [message #84865 is a reply to message #84716] Thu, 06 May 2004 02:43 Go to previous message
A Ikramur Rahman
Messages: 81
Registered: May 2004
Member
Krishanu

Field type should be Datetime instead of Date. Then your problem will be resolved.

Regards

A Ikramur Rahman
Previous Topic: books on Deveopler 9i
Next Topic: commit statement problem!
Goto Forum:
  


Current Time: Tue May 07 08:25:58 CDT 2024