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

Announcements

News and Announcements icon
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,812 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
    101,995 Super User 2026 Season 1 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,028 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,366 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,175 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans