Solved

Crystal Reports - display sum of date and year

Posted on 2009-04-09
6
308 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
ID: 24106018
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
ID: 24106166
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
ID: 24106240
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:edmacey
ID: 24106916
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
ID: 24107044
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
ID: 31568439
User error with the previous ones, it was my own fault it wasn't working, got it working now. thanks ed.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tidtcpserver connection lost handle 2 83
c++ reading data from file into two dimensional array 3 107
Crystal Reports 13 5 58
Definitions and default visual studio colors 5 65
This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

785 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