?
Solved

Crystal Report 11 -- Formula help -- concat

Posted on 2010-11-17
8
Medium Priority
?
831 Views
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.

Thanks,

CR-Concat-date-and-year.xls
0
Comment
Question by:D-pk
[X]
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
8 Comments
 
LVL 12

Expert Comment

by:JayConverse
ID: 34159104
ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))
0
 

Author Comment

by:D-pk
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

Thanks
0
 

Author Comment

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

http://www.experts-exchange.com/Database/Oracle/Q_26619665.html

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
LVL 12

Expert Comment

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

Author Comment

by:D-pk
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?
0
 
LVL 12

Expert Comment

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

Accepted Solution

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

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

Author Closing Comment

by:D-pk
ID: 34168709
Thanks JayConverse! everything worked great...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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. …
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 …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

765 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