Si8
Si8

Reputation: 9225

How to get current and next year in infopath

I have a field (todaysDate) which has the following function: today().

I am displaying that value in a field (textbox) with the function: substring(todaysDate, 1, 4) which only gives the year.

I have another field (textbox) which I would like to show the value for the following year.

So for example:

`todaysDate`: `2015-10-21`
`textbox`: `2015`
`textbox`: `2016`

Upvotes: 0

Views: 3917

Answers (2)

Si8
Si8

Reputation: 9225

To get the current year I added a new field:

todayYear: substring(now(), 1, 4)

To get next year I added another new field:

nextYear: sum(todayYear) + 1

Upvotes: 2

Sergio Internicola
Sergio Internicola

Reputation: 347

The second textbox must have the function:

val(substring(todaysDate, 1, 4))+1

Upvotes: 1

Related Questions