[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Converting dates to Julian Format



Kara,

The following code will work in Oracle [the *only* true RDBMS ;-)].

select to_number(to_char(sysdate, 'j')) -
       to_number(to_char(to_date('01-JAN-98', 'DD-MON-YY'), 'j'))
from [table_name]

Of course this will only work for this year.  You could build the
'01-JAN-YY' on the fly and use a dynamic variable, I think (too early in
the morning to be doing that) to handle other years.

You could also use a shell command, if you are running this on a Unix
platform (some of them) you can return the julian date from there.

And, PSoft probably has a conversion .sqc to handle this too.

clark

----Original Message Follows----

I need to convert a date to julian format in my sqr.  I am working with
PeopleSoft and was wondering if there is a delivered SQC which will do
this conversion.  I am also using Oracle so if anyone knows if Oracle
can handle the conversion please let me know.  I appreciate your help!



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com