|
Subject:
|
Julian Date
|
|
Posted By:
|
motupally
|
Post Date:
|
11/10/2003 10:16:10 PM
|
Dear All,
What I need is to pass a current date and get the last date of the year as julian date, i.e. in this format 731580.
(if 731580 is converted to date then it will read like 31-Dec-2003, this is just an example )
Thanks for your help.
Praveen Motupally
|
|
Reply By:
|
sal
|
Reply Date:
|
11/11/2003 3:54:09 PM
|
How did you get 31-Dec-2003 from 731580. This will have to be done with a UDF or Stored procedure. I do not know of a function that automatically does it.
check this links, maybe they will help.
http://www.sqlmag.com/Forums/messageview.cfm?catid=22&threadid=496
http://www.sqlmag.com/Forums/messageview.cfm?catid=9&threadid=15365
Sal
|
|
Reply By:
|
motupally
|
Reply Date:
|
11/12/2003 3:38:51 PM
|
Hi Sal,
Yes this has to be done in the SP or UDF, any example will be greatly appreciated.
All the dates are stored as julian dates in out DB, I need to get all the records upto the current year end, so, for example we pass the current julian date then it has to return the last date of that year.
Regards
Praveen Motupally
|
|
Reply By:
|
sal
|
Reply Date:
|
11/12/2003 4:09:08 PM
|
What format of julian date are you using. I have done this with Java, but not with SQL Server. If you do a search on the web, you can find sample code, mostly in C, for calculating the julian date (Day Of Year). I will dig into my stuff and see if I find it.
Sal
|
|
Reply By:
|
motupally
|
Reply Date:
|
11/13/2003 10:39:50 PM
|
This is the format we use 731442 to store the date, for everydate I need to find the last day of the year. like to do this in the stored procedure.
Thanks 
Praveen Motupally
|