• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 838
  • Last Modified:

Crystal Report 11 -- Formula help -- concat

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
D-pk
Asked:
D-pk
  • 4
  • 4
1 Solution
 
JayConverseCommented:
ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))
0
 
D-pkAuthor Commented:
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
 
D-pkAuthor Commented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
JayConverseCommented:
I don't understand the question about concatenating.  What is the "Sal"?
0
 
D-pkAuthor Commented:
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
 
JayConverseCommented:
ToString(ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))) & " Salary"
0
 
JayConverseCommented:
Oops, wrong language, I mean:

ToText(ToNumber(ToText({Command.PAYMENTDATE},"yyyyMM"))) & " Salary"
0
 
D-pkAuthor Commented:
Thanks JayConverse! everything worked great...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now