Julian Date

Hello, I was wondering if anyone has a quick solution to coding the the “julian date” from the beginning of the year to WORKDATE. So since today is Sept 10th. the julian date today would be 253. Thanks alot![:)]

Function Juliandate(IDate : Date) Jdate : Integer C/AL locals Name DataType Subtype Length day Integer month Integer year Integer i Integer ` day := DATE2DMY(IDate,1); month := DATE2DMY(IDate,2); year := DATE2DMY(IDate,3); IF (year MOD 4) = 0 THEN i := 1 ELSE i := 0; CASE month OF 1: Jdate := day; 2: Jdate := day + 31; 3: Jdate := day + 59 + i; 4: Jdate := day + 90 + i; 5: Jdate := day + 120 + i; 6: Jdate := day + 151 + i; 7: Jdate := day + 181 + i; 8: Jdate := day + 212 + i; 9: Jdate := day + 243 + i; 10: Jdate := day + 273 + i; 11: Jdate := day + 304 + i; 12: Jdate := day + 335 + i; END;` Call the function like this `MESSAGE (FORMAT(Juliandate(TODAY)));`

Or try this one: intYear := DATE2DMY(WORKDATE, 3); message(’%1’,WORKDATE - DMY2DATE(1, 1, intYear));

Function Juliandate(IDate : Date) Jdate : Integer C/AL locals Name DataType Subtype Length year Integer Firstofjan Date ` year := DATE2DMY(IDate,3); Firstofjan := DMY2DATE(01 , 01 , year); Jdate := (IDate - Firstofjan) + 1; ` Call the function like this MESSAGE (FORMAT(Juliandate(WORKDATE))); Here is a new version [:D]

I got it! Thanks for all your help.