Skip to main content

Notifications

Community site session details

Community site session details

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

Null date values via API ?

(0) ShareShare
ReportReport
Posted on by 21

Hello,

we provide data via API interface. In our case some date fields are NULL. These NULL values are represented as 0001-01-01 in the API. When trying to write the data to a SQL database, we get an error because the min. date is 1753-01-01.

How do you handle such problems ?

With NULL values are actually meant 0D values

  • Suggested answer
    Tech-Lucky Profile Picture
    844 on at
    RE: Null date values via API ?

    You need to manage this issue at the code level only the Null values stored in our SQL Database as 1900-01-01 or 1753-01-01 etc what I do is Extract the Year from the Date and compare it with IF Year>2000 then only assigned the Date to my Table Field else I skip the API value to be modified in my Date type Field to ignore this kind of default values.

    mark my answer as verified if this was helpful

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,110 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans