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 :
Power Platform Community / Forums / Power Apps / Datetime in Model-Driv...
Power Apps
Answered

Datetime in Model-Driven-App with Virtual Table

(0) ShareShare
ReportReport
Posted on by 43
Hello,
I have a created a virtual table with a table in SQL Server as datasource to create a model-driven-app that will allow users to maintain some records. There are around 50 columns most of them varchar, int, bit and datetime.
 
The read and update records work, but I'm having issues to create new records. The following error is thrown:
 
"The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value."
 
I don't have any datetime2 type in my SQL Server (as I know it is not supported by Virtual tables). As a remark, all datetime columns allow null.
 
I have the impresion that dataverse is trying to send the default value "0001-01-01" instead of null and that's causing the issue, is there anyway I can make it work?
 
Thank you very much in advance.
 
Best regards,
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,363 Most Valuable Professional on at
    I don't think there is any way around that problem since you are using a Dataverse Virtual table.  Since you can't force it to send a null, I would suggest defaulting the datetime fields you do have to 1753-01-01.  That should be the earliest available date for a SQL table.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Verified answer
    Braaank Profile Picture
    43 on at
    Thank you very much for the answers.
     
    At the end I was able to solve the issue. Apparently there was a datetime column in SQL Server which was not allowing NULL value but has as default value getdate(). I was able to sort out the issue by removing that column in Dataverse so it doesn't even send it during the creation of the record. The only disadvantage would be that I won't be able to retrieve it, but that's not a requirement at this point.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 450 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 448

Last 30 days Overall leaderboard