Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Crystal Report 11 -- Formula help -- concat

Posted on 2010-11-17
Medium Priority
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:


Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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 2000 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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

618 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