I searched in the OSI site, but can't find a quick answer. I can create Year('*') variable, but can't figure out a way of showing it as 2 digit. I tried format function, but none of my attempts work.

Thanks.

I searched in the OSI site, but can't find a quick answer. I can create Year('*') variable, but can't figure out a way of showing it as 2 digit. I tried format function, but none of my attempts work.

Thanks.

- 3 people found this helpful
You can also use the formula below, which is shorter than Sebastien Raposo's formula and avoids conversion to a string.

Year('*') Mod 100

This formula works regardless of what timestamp you use in place of '*'.

If you plan on replacing '*' with some time in the year 2010 or later, you could even use this:

Year('*') - 2000

If you wanted the answer to be a string, just wrap the formulas with the String function:

String(Year('*') Mod 100)

String(Year('*') - 2000)

These are still shorter (in terms of character count) and easier to read than Sebastien's answer (no offense!):

Right(String(Year('*')),2)

You can also use the formula below, which is shorter than Sebastien Raposo's formula and avoids conversion to a string.

Year('*') Mod 100

This formula works regardless of what timestamp you use in place of '*'.

If you plan on replacing '*' with some time in the year 2010 or later, you could even use this:

Year('*') - 2000

If you wanted the answer to be a string, just wrap the formulas with the String function:

String(Year('*') Mod 100)

String(Year('*') - 2000)

These are still shorter (in terms of character count) and easier to read than Sebastien's answer (no offense!):

Right(String(Year('*')),2)