Home » RDBMS Server » Server Administration » Julian date
Julian date [message #372648] Thu, 01 March 2001 18:19 Go to next message
M.H
Messages: 3
Registered: March 2001
Junior Member
My sql is : SELECT * FROM tblContract WHERE endDate < SYSDATE

the field endDate is type of Julian date, so it gives me an error: inconsistent data type. Please show me how to convert from Julian date to date? Thanks.
Re: Julian date [message #372657 is a reply to message #372648] Fri, 02 March 2001 09:10 Go to previous messageGo to next message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

SELECT * FROM tblContract WHERE to_date(endDate, 'DDD') < SYSDATE;

Bala
Re: Julian date [message #372661 is a reply to message #372657] Fri, 02 March 2001 11:53 Go to previous messageGo to next message
ramu
Messages: 82
Registered: February 2001
Member
Let me know how to declare and insert value for a Julian Date field...

Thanks..

Ramu..
Re: Julian date [message #372663 is a reply to message #372661] Fri, 02 March 2001 13:16 Go to previous message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi Ramu

You can declare julian date as interger,
and while inserting convert it to a date field.

(Date is strored as binary format in oracle,
and you can display it or pass it in any format you want.)

EX.
create table t1 (id number, mydate date);

declare v_juliandate int;
v_id int;
begin
......
insert into t1(id, mydate) values(v_id, to_date(v_juliandate, 'DDD');

end;

Its always better to store date as date format in oracle table. Its more efficient, as you can use built-in date functions.

Hope this helps
Bala
Previous Topic: how to detect and remove the duplicate records
Next Topic: How to insert an & in a varchar2 throw a SQL script ?
Goto Forum:
  


Current Time: Sat Jun 29 09:07:28 CDT 2024