Concatenate integers
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have two fields that are year and month and are integers. I am trying to concatenate these two fields so they go display like 2020-01,2020-02, etc
i cannot figure out how to do this with tostring and padleft functions. i keep getting malformed function errors.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi
You can change the data type of those two fields to strings and try this expression in the formula tool [year]+ "-"+[month].
hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
how do i get the zero to populate? i want it to read 2020-01 not 2020-1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@parria1 - check out the attached solution:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
after you change the data types to strings use this PadLeft([month], 2, '0')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
THIS GIVES ME A MALFORMED FUNCTION CALL
tostring([order_yr] + "-" + padleft(tostring([order_mth_num]),2,"0")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
you are missing a ")"
tostring([order_yr]) + "-" + padleft(tostring([order_mth_num]),2,"0")
that should work
