SAP Knowledge Base Article - Public

1804866 - How to convert Current date to Julian date in Crystal Reports?

Symptom

How to convert Current date to Julian date format?

Environment

  • Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Resolution

  1. Create a formula that will calculate the Julian Date as:

    numberVar y:=year(CurrentDateTime);
    numberVar m:=month(CurrentDateTime);
    numberVar d:=day(CurrentDateTime);

    numberVar JD;

    JD:=(367*y)-Truncate((7*(y+Truncate((m+9)/12))/4))+Truncate(((275*m)/9))+d+1721013.5-(.5*Sgn(((100*y)+m)-190002.5))+.5

  2. Save and close the formula editor.

NOTE: This only takes into account month, day and year and not current time and also is only good until 2099.

See Also

KBA 1263435

Keywords

Current Date to Julian date, Julian Date format , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011