Solved

Crystal Reports Formula Adding 1 to a Year "String" Field

Posted on 2013-12-02
8
919 Views
Last Modified: 2013-12-20
Hello:

Below is an excerpt from an "If, Then" statement that I'm using in a formula in Crystal Report XI.

I need to edit the end of this formula.  Specifically, I need to mathematically add a "1" so that the phrase displays "Month of January 1, 2014".  As it is, the formula displays "Month of January 1, 2013".

When I try to tell Crystal's Formula Editor to add "1" to the year, it tells me that a string is required or something along those lines.

What syntax do I use to tell Crystal to add "1" to a year?  I'd rather not have to hard-code in the year.  

Thanks!

TBSupport


If {IVC10100.COMMNTID} = "JAN" then "Month of January 1, 20"+mid({IVC10100.INVCNMBR},3,2)
0
Comment
Question by:TBSupport
8 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 39691693
Try this

If {IVC10100.COMMNTID} = "JAN" then "Month of January 1, 20"+CStr(Val(mid({IVC10100.INVCNMBR},3,2) + 1),0)

mlmcc
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 250 total points
ID: 39692104
I think one of the right parentheses in mlmcc's solution is in the wrong place.  I think it should be.

If {IVC10100.COMMNTID} = "JAN" then "Month of January 1, 20"+
 CStr(Val(mid({IVC10100.INVCNMBR},3,2)) + 1,0)


 James
0
 
LVL 34

Expert Comment

by:James0628
ID: 39696316
mlmcc should get at least most of the credit for the solution.  I was just pointing out a small mistake.

 You can use the "Request Attention" link to ask to have the question re-opened, and then accept mlmcc's post as the solution, instead of mine.

 James
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:modus_operandi
ID: 39732105
I've requested that this question be closed as follows:

Accepted answer: 250 points for mlmcc's comment #a39691693
Assisted answer: 250 points for James0628's comment #a39692104

for the following reason:

TBSupport,
 
I have reopened your question and started the process of closing it with a split amongst two or more Experts, as that outcome seems more equitable than your original disposition.
 
modus_operandi
EE Admin
0
 
LVL 1

Author Comment

by:TBSupport
ID: 39723822
If you need to split the credit, that's fine, of course.
0
 
LVL 1

Author Comment

by:TBSupport
ID: 39731765
Is there anything else that I need to do?  I'm confused, as to why this is remaining in my "Open Questions" box.
0
 
LVL 34

Expert Comment

by:James0628
ID: 39731994
The admin started a process to reclose the question, but it doesn't happen for a few days (to give people time to object, I guess).  I imagine that you could just close the question yourself (but include mlmcc's post as part of the solution this time).  Otherwise, the question should be closed today, or in the next day or two.

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now