Skip to Content
author's profile photo Former Member
Former Member

Trim?

I created a variable named [Adj Year] that is returning the year as 2,014.

The variable formula is:

=If((MonthNumberOfYear([Scheduled First Payment])-1)=0 Then ((Year([Scheduled First Payment])-1)) Else (Year([Scheduled First Payment]))

The value that is returning from this variable is accurate, however, I would like to display only the year value...in this case, '14'

I have tried a couple of different things but am getting invalid date type errors.......

Can I create a new variable to simply trim [Adj Year] to display the last two characters?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2015 at 05:04 PM

    Hi,

    try this :

    [Year two digits ] = Right(""+If((MonthNumberOfYear([Scheduled First Payment])-1)=0 Then ((Year([Scheduled First Payment])-1)) Else (Year([Scheduled First Payment]));2).

    What I´m doing is :

    1 - Converting the Year returned, from number to text , (when I add a ""+ n front of any number, I´m typecasting - the process of transforming the type of a variable - the number to text) ;

    2 - Take the two characters at the right.

    Regards,

    Rogerio

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2015 at 06:01 PM

    =Mod([Adj Year];100) will do what you want.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.