Solved

Crystal Report 11 -- Formula help -- concat

Posted on 2010-11-17
8
825 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
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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 500 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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