Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Datetime variable passed to SQL stored procedure doesn't include seconds or milliseconds

(1) ShareShare
ReportReport
Posted on by
Hello all, 
 
I'm building a function in a canvas app that executes a SQL stored procedure. The procedure is passed a row ID and what the row's last modified datetime should be, and if it finds a row where both match, it deletes it. It executes with no errors, but it outputs zero rows deleted and the row is still present in the SQL table. Everything works as intended when executed in SSMS.
 
The row in the SQL table has a last modified datetime of "2025-01-16 10:38:44.947". The record in PowerApps looks to have an accurate datetime of "1/16/2025, 10:38:44 AM"; even though the preview doesn't show milliseconds, it returns the correct epoch time when cast to a value. However, the stored procedure reports that it's being passed "2025-01-16 10:38:00.000". I don't have access to the SQL logs so can't tell if it's receiving zeroes or just no seconds or milliseconds.
 
I've tried passing the epoch time, but my version of SQL can't convert it to a datetime. Casting the datetime to text also omits seconds and milliseconds. I'm working on changing the stored procedure to accept an epoch time and convert it to a datetime using dateadd, but would rather not leave it like that.
 
Has anyone else encountered this before? And does anyone know of a better workaround than what I came up with?
Categories:

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard