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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Error: The following fields must be of the same type

(0) ShareShare
ReportReport
Posted on by 30

Hello guys,

I currently get the error message when I call a table with Run that two fields must have the same data type.

Field:      Approved On <- Approved on
Table:    Table A <- Table B
Type:      DateTime <- Date

Now I was thinking about just changing the datatype Date to DateTime, but I am afraid that this could lead to a loss of data. Is this the case?

What is the best way to correct this error?

Thank you!


I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,700 Moderator on at

    Hi Maddin ,

    It happens when you are using Copy function of Transferfields function between two tables.

    To overcome this situation use below logic

    First create a new field with the same data type which you dont want to loss data, and then put some logic so that you can transfer that field's value into new field and then please change the Datatype to resolve the error, and check then if data loss if yes then move your data from new field to old field (after changed the data type).

    Hope this logic will help you.

  • Verified answer
    YUN ZHU Profile Picture
    95,485 Super User 2025 Season 2 on at

    Hi, just adding to Nitin's reply, It is not recommended to modify the data type directly. You can first use the following method to transfer the data in the table to another new temporary field, then modify the data type, and then transfer back. Finally delete the temporary field.

    CREATEDATETIME Function (DateTime)

    https://docs.microsoft.com/en-us/dynamics-nav/createdatetime-function--datetime-

    Hope this helps.

    Thanks.

    ZHU

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,098

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,556 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,108 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans