SAP Knowledge Base Article - Public

1263435 - How to switch between a Julian Date and a Date in Crystal Reports?

Symptom

  • How to convert a Julian Date to a Date?
  • How to convert a Date to a Julian Date in Crystal Reports?
  • Not able to see the functions: DateToJulian or JulianToDate in the Formula Workshop in Crystal Reports.

Environment

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

Cause

  •  Julian dates (abbreviated as JD) are a continuous count of days from January 1, 4713 BCE on the Julian calendar.

Resolution

  • To convert a Julian Date to a Date, or a Date to a Julian Date in Crystal Reports, uses the additional functions added by the User Function Library (UFL) Julian Date:
         
    1. Download the Julian Date UFL: ufljul.exe, from the Attachments section below.
           
    2. After the ufljul.exe is downloaded, rename the extension from .exe to .zip, and extract the UFL:  U2LJUL.DLL
           
    3. Copy the file: U2LJUL.DLL to the following path: 
        
      • For Crystal Reports 2008
        C:\Programs Files\Business Objects\ Business Objects Enterprise 12.0\win32_x86 
           
      • For Crystal Reports 2011, 2013, 2016
        C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86
             
    4. Launch Crystal Reports, and open a report.

      Note: When launching Crystal Reports, the Julian Date UFL will automatically add the additional functions JulianToDate and DateToJulian to Crystal Reports.  
              
    5. To convert the value, create a formula, and use the new function:
      • To convert a Julian Date to a Date use the function: JulianToDate
      • To convert a Date to a Julian Date, use the function: DateToJulian
             
      • The Syntax for the functions are:     
        DateToJulian (date) - Takes a date field and returns the Julian date values.  ( Note: Result will be rounded if there is decimal. )
        JulianToDate (number) - Takes a Julian date and returns the date value.
             
      • Examples:
        DateToJulian (date(2001,10,28)) will convert the date to the Julian Date numeric value of: 2452211
        JulianToDate (2452211) will return 10/28/2001, which is 2,452,211 days from January 1, 4713 B.C.

Keywords

CR, JD , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016

Attachments

ufljul.exe