Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

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.
0
edmacey
Asked:
edmacey
  • 4
  • 2
1 Solution
 
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
 
SpykairCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now