Solved

Crystal Reports - display sum of date and year

Posted on 2009-04-09
6
289 Views
Last Modified: 2012-05-06
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
Comment
Question by:edmacey
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:Spykair
Comment Utility
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
 

Author Comment

by:edmacey
Comment Utility
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
 
LVL 10

Accepted Solution

by:
Spykair earned 500 total points
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:edmacey
Comment Utility
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
 

Author Comment

by:edmacey
Comment Utility
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
 

Author Closing Comment

by:edmacey
Comment Utility
User error with the previous ones, it was my own fault it wasn't working, got it working now. thanks ed.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now