Skip to Content
0
Former Member
Jan 23, 2013 at 05:46 PM

crystal reports convert date to julian formula

214 Views

Hello world! I am new to Crystal Report 2011.. and i am trying to teach my self how to build reports. So i have one that i am trying to pull out 6 months of data from a JDE server, I have my dates... I have 6 of these named month 1 - 6...I am trying to convert them to julian formate so that i can pull my data. I do not know how to create the convert to julian formula...

BeforeReadingRecords;

Local dateVar back2;

Local dateVar back2start;

back2 := CDate(DateAdd("m",-2,CurrentDate));

back2start := Date(Year(back2),Month(back2),01);

back2start

and End

BeforeReadingRecords;

Local dateVar back2;

Local dateVar back2end;

back2 := CDate(DateAdd("m",-1,CurrentDate));

back2end := CDate(DateAdd("d",-1,Date(Year(back2),Month(back2),01)));

back2end

Convert to julian attempt:

BeforeReadingRecords;
EvaluateAfter ({@Month2Start});

NumberVar yyYear;

yyYear := DatePart ("YYYY",Minimum({@Month2Start}));
yyYear := (yyYear - 2000) * 1000;
100000 + yyYear + DatePart ("y",Minimum({@Month2Start}));

and you guessed it... It's not working.. Can anyone shed some light on this please