Crystal Report 11 -- Formula help -- concat

Posted on 2010-11-17
Last Modified: 2012-05-10
I want to concatenate month and year and convert that to a number.
For example,
DatePart ("m", {Command.PDATE}) which gives just the months
DatePart ("yyyy", {Command.PAYMENTDATE}) which gives just the year

my goal is to concatenate both these values and convert this to a number.
For ex: 200809 (Sep 2008) this should be a number.

I am trying to acheive alternate  graying in a cross-tab. which I almost got it.
My cross-tab report has a dummy column (formula) which is suppressed, The formula has
DatePart ("m", {Command.PDATE})

and in the formatting of the value field,
I have this formula in the background button

if remainder(GridRowColumnValue("drow"), 2) = 1 then crblue else crLime

//drow is the alias i gave for the dummy column I inserted.

If you see the attachment the coloring is appropriate, but the ordering is jacked up, its not in the ascending order, which is obvious because it takes only the month part of it. So if I could include the year too, then it will be in the right order.


Question by:D-pk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 12

Expert Comment

ID: 34159104

Author Comment

ID: 34159518
Thanks JayConverse, it was exactly what i needed.
one more quick question...
How can I concatenate string along with the column,
for ex:

currently we have
200811 200812  200901 200902 ....

what i wud like to have is:
200811 200812  200901 200902 ....
 Sal          Sal           Sal          Sal


Author Comment

ID: 34159535
and also changing the name of the summary field label..
This is with regards to this thread:

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

LVL 12

Expert Comment

ID: 34160419
I don't understand the question about concatenating.  What is the "Sal"?

Author Comment

ID: 34161708
its just a string, like Salary...
i just want that string to be concatenated along with those dates.
200801 Salary   200802 Salary 200803 Salary...
makes sense?
LVL 12

Expert Comment

ID: 34162997
ToString(ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))) & " Salary"
LVL 12

Accepted Solution

JayConverse earned 500 total points
ID: 34162999
Oops, wrong language, I mean:

ToText(ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))) & " Salary"

Author Closing Comment

ID: 34168709
Thanks JayConverse! everything worked great...

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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