Crystal Reports - display sum of date and year

I have been following the guide at www.ml-consult.co.uk/cryst-06.htm to create a calendar style report.

I would like to tweak it slightly, the date is displayed by summing a formula, the formula is

if DayOfWeek ({xl.date}) = 1 then Day({xl.date})

which has the effect of displaying the correct date.

What I would like it to also display is the year so that instead of just saying 01, it says 01 January.

The date field that it calls from contains the month.

Thanks Ed.
edmaceyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SpykairConnect With a Mentor Commented:
Your formula will be:
if DayOfWeek ({xl.date}) = 1 then Date({xl.date})

Then place the formula field in the report.
Right click on the formula field -> format field -> select the date mask that will show "1-Mar' or something like that.

Spykair
0
 
SpykairCommented:
Change it to this:
if DayOfWeek ({xl.date}) = 1 then Date({xl.date})

Then format your field to only display it as 1-Month

Spykair
0
 
edmaceyAuthor Commented:
It doesn't like that, I have changed first dayofweek to be monday. how do i change the sum by adding 1-month in there?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
edmaceyAuthor Commented:
Okay thanks, I can get that to work if I were using those fields in the report however I am taking summaries of them which are numbers and can't be represented as dates.
0
 
edmaceyAuthor Commented:
Actually I  can now get that to work fully, except it doesn't seem to accept my CrMonday criteria to make Monday the first day of the week.

if DayOfWeek({caldates.Date},CrMonday) = 1 then Date({caldates.Date})
0
 
edmaceyAuthor Commented:
User error with the previous ones, it was my own fault it wasn't working, got it working now. thanks ed.
0
All Courses

From novice to tech pro — start learning today.