SAP Knowledge Base Article - Public

1549336 - How to display time on X-Axis of the chart in HH:MM am/pm format in Crystal Report?


How to Display time on X-Axis of the chart in HH:MM format?


  • Crystal Reports 2008
  • Crystal Reports XIR2


  1. Create a Formula named Time as given below:

         if (hour({Table_Name.TIME})>12)
         then totext({Table_Name.TIME}, "HH:MM") + "pm"
         else if (hour({Table_Name.TIME})=12) and (minute({Table_Name.TIME})>0)
         then totext({Table_Name.TIME}, "HH:MM") + "pm"
         else if(hour({Table_Name.TIME})=12) and (minute({Table_Name.TIME})=0) and (second({Table_Name.TIME})>0)
         then totext({Table_Name.TIME}, "HH:MM") + "pm"
         totext({Table_Name.TIME}, "HH:MM") + "am";


   2. In the chart expert, Insert this formula (Time) under "On change of" section

   3. Take another field which needs to be on the Y-axis under "Show value(s)" section.

   4. Click on OK in the cHart expert.

   5. You will get the time value appearing on X-axis in HH:MM am/pm format as shown below:



Note: In the chart shown above, name of the formula is Test which is on X- Axis.


Time, X-Axis, HH:MM format, Chart, Crystal Report , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To


Crystal Reports 2008 V0