You are viewing limited content. For full access, please sign in.

Question

Question

Month as two digits

asked on August 11, 2022

Hi All,

I have been trying to use the following formula in the Modern Designer to display the year-month-boxnumber. I needed the month figure to be two digits. For example, 2022-08-1342

=CONCATENATE(YEAR(Date_1),"-",RIGHT("00" &MONTH(Date_1), 2),"-",(Previous_Box_Number+1))

However, this returns a single month digit.  2022-8-1342

If I use the RIGHT("00" &MONTH(Date_1), 2) in a separate Single Line field (on the same form), it works and shows 08.

If I use the separate Single Line field variable in the first formula, it still removes the leading zero.

 

Running latest release of Forms 11. Modern Designer.

0 0

Answer

SELECTED ANSWER
replied on August 22, 2022

Hi All, 

This formula ended up working for me.

 

=JOIN("",[YEAR(Proposed_Destruction_Date),"-",RIGHT("00" & TEXT(MONTH(Proposed_Destruction_Date)), 2),"-",Next_Box_ID])

 

Using JOIN instead of CONCATENATE

0 0

Replies

replied on August 11, 2022

Looks like a bug to me.

The formula works as expected in the classic designer, but in the modern designer the 0 gets stripped off as soon as you wrap any other function around RIGHT.

As a workaround, you can wrap MONTH in TEXT and that seems to work since that converts the value to a string before it gets touched by any other functions.

RIGHT("00"&TEXT(MONTH(Date_Field)), 2)

0 0
replied on August 12, 2022

Thanks Jason,

However, that didn't work for me either. 

Even simplifying the formula didn't work. It doesn't like having more than one zero either. "0000" gets stripped to "0"

=YEAR(Proposed_Destruction_Date)&"-"&"01"&"-"&(Previous_Box_Number+1)

That formula still gets the quoted "01" stripped to "1"

 

 

0 0
SELECTED ANSWER
replied on August 22, 2022

Hi All, 

This formula ended up working for me.

 

=JOIN("",[YEAR(Proposed_Destruction_Date),"-",RIGHT("00" & TEXT(MONTH(Proposed_Destruction_Date)), 2),"-",Next_Box_ID])

 

Using JOIN instead of CONCATENATE

0 0
replied on January 9, 2023

This bug has been fixed for Forms 11 Update 3.

  • Leading zero from result of RIGHT formula is no longer trimmed when being used with CONCATENATE formula. (391025)

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.