web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Concatenation of two fields

(0) ShareShare
ReportReport
Posted on by 700

Hi All,

I have created two fiels i.e. one for storing month and the other one for year. Now, I have to combine both fields in a new one.

How to achieve this ?

Any code suggestion !

Thanks !

Categories:
  • ManishS Profile Picture
    86 on at

    What result are you expecting, can you share that too ?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    Use DMY2DATE function to convert to date.  

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    A := FORMAT(Month) + FORMAT(Year)

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Can you please provide more clarification ? Didn't get your answer.

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Date field is not needed. We have to concatenate only month and year fields to a new field.

  • Dynamics 365 Business Central Profile Picture
    700 on at

    We have one field for storing month and the other one for storing year. Now, we need to create a new field which will store the month and the year (i.e. by concatenating both the fields).

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    What are the data types for Month and Year, and the new field? As Teddy mentioned Just use the Format function to convert month and Year to string and concatenate using + and assign to your new field.

    You need to provide the full requirement and what are you planning to do.

  • Dynamics 365 Business Central Profile Picture
    700 on at

    For month, I am using 'Option' data type and for Year, it is 'Integer'. What should be the data type for the new field ideally?

    My only requirement is to display the the data in month and year format, date is not needed to be mentioned.

  • Dynamics 365 Business Central Profile Picture
    700 on at

    Where to use the Format function, in table or in page ? In both places, it is not accepting. VS Code version is 1.37.1

  • Verified answer
    Avinash B Profile Picture
    1,455 on at

    Hi

    You can use Text or Code datatype for the new field.

    You can concatenate like this

    Newfield = FORMAT(Month) + ' - ' + FORMAT(Year);

    If my answer helps to resolve your issue, please verify it by clicking Yes

    Regards

    Avinash B

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans