cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CMacLean
Frequent Visitor

SQL datetime conversion bug - PowerApps Release 3.20073.20

I put out a new build of an app on 4th August which had previously been working well under release 3.20062.19, however, something in the background seems to have changed which results in incorrect time values being retrieved from SQL tables and views. The SQL field in question is a DateTime field to record the last updated time for the record. When I patch the table with Now(), the correct value is stored. When I then retrieve the value with Filter or Lookup, the date/time is a random number of minutes in the future. 

 

I've created a very simple app to patch in the current time to SQL as both a date/time and a string. The data stored in the database is all OK. Refreshing the data table in the app does not change the values, they remain displayed consistently incorrectly. It's  as if the thousands of seconds are being added on as minutes. This is my app to demonstrate and data:

 

CMacLean_1-1596670173924.png

 

Data recorded in SQL:

CMacLean_2-1596670223822.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

I didn't get any response from anybody on this issue but it appears that some change has been made in the last 24 hours which resolves the issue of incorrectly retrieved DateTime from SQL which I had observed. If you edit and republish any affected apps, they should now work correctly. 

 

As a solution to this issue whilst the bug existed, I retrieved the DateTime as a string from an SQL view rather than as DateTime type directly from the table using this expression in the SELECT statement:

CONCAT(
CONVERT(nvarchar(30),LastUpdated,24),
' on ',
CONVERT(nvarchar(30),LastUpdated,6)
) as LastUpdateTime

 

View solution in original post

4 REPLIES 4
CMacLean
Frequent Visitor

Does anyone know how I can report this bug to the developers?

 

I can't see that anyone else has reporting the bug in this forum but I can't believe that nobody else will have the same experience. I've run over 50 tests and found that the date time shown in powerapps is anything between 1 second and 167minutes later than the stored date time value.

I didn't get any response from anybody on this issue but it appears that some change has been made in the last 24 hours which resolves the issue of incorrectly retrieved DateTime from SQL which I had observed. If you edit and republish any affected apps, they should now work correctly. 

 

As a solution to this issue whilst the bug existed, I retrieved the DateTime as a string from an SQL view rather than as DateTime type directly from the table using this expression in the SELECT statement:

CONCAT(
CONVERT(nvarchar(30),LastUpdated,24),
' on ',
CONVERT(nvarchar(30),LastUpdated,6)
) as LastUpdateTime

 

View solution in original post

akhtarmiah
Frequent Visitor

If you are still have issues with datetime inconsistency between SQL Table and the PowerApps Value please convert the table column from datetime to datetimeoffset(7).

 

hope this helps

Just noticed that the PowerApps release has changed to 3.20081.20. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,947)