General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Convert month to number without leading zero

mestra28
6 - Meteoroid

Hello,

 

I currently wanted to construct a workflow that pulls in the last month as a number without a leading zero.

I came up with this:

(DateTimeFormat(DateTimeAdd(DateTimeFirstOfMonth(),-1,"months"),"%m")

However I want to get rid of the leading zero.

 

3 REPLIES 3
binuacs
21 - Polaris

@mestra28  the TrimLeft function will be useful in this use case

 

binuacs_0-1649887453571.png

 

 

 

 

 

TrimLeft( DateTimeFormat(DateTimeAdd(DateTimeFirstOfMonth(),-1,"months"),"%m"),'0')

 

 

Qiu
21 - Polaris
21 - Polaris

@mestra28 
you mentioned that you want a number, so use ToNumber function to convert the string to number will natually remove the leading zero.

0414-mestra28.PNG

mestra28
6 - Meteoroid

@binuacsThis worked, thank you!

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels