Monday, August 29, 2011

Crystal Reports : Displaying the Day of Week from a Date

A client asked: I would like to display the day of the week on the detail line along with the date. How do I do this?


Using the example of CREATEON in Goldmine Contact1, you would do the following:

Create a formula using the DayOfWeek function called DayPosition as follows. This will create the numerical position of the date (e.g. 1=Sun, 2=Mon, etc)

DayOfWeek ({Contact1.CREATEON})

Then create a formula called DayName. This will add the name to the report (Mon, Tue, Wed). Use the function WeekDayName and add the DayPosition as the function detail

WeekdayName ({@DatePosition})

Drag the DayName formula to the detail row next to the CREATEON date. It will list the weekday name of the CREATEON date.

2 comments:

Anonymous said...

I need to develop a Japan report that has invoice date as 2012年2月22日 which means 22-Feb-2012.

Any hint on this requirement will save lot of time.

Justin Hill said...

You can change the Data format of any Crystal field by right-clicking, selecting "Format Field", then selecting the appropriate format. I.e. 02/01/2012, 2012-02-01, etc.

As far as generating the kanji characters, you may need to create a custom formula to insert these characters in the appropriate places.

Good luck and let us know how you make out!