Saturday, August 29, 2009

Crystal Reports : Display 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.

No comments: