web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Verified answer
    YUN ZHU Profile Picture
    91,871 Super User 2025 Season 2 on at
    RE: Error: The following fields must be of the same type

    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

  • Suggested answer
    Nitin Verma Profile Picture
    21,664 Moderator on at
    RE: Error: The following fields must be of the same type

    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.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,844

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,010

#3
Sumit Singh Profile Picture

Sumit Singh 2,815

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans