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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to set up a date f...
Power Automate
Unanswered

How to set up a date field in SQL so it will work with Power Automate and Power Apps

(0) ShareShare
ReportReport
Posted on by 2 Moderator

Hello,

 

I am setting up an MSSQL onprem server and want to have a date column in one table.

 

What I need to do with it:

1. PowerApps needs to write the current Date and Time into records stored in the SQL server

2. PowerApps needs to display the date (as dd.MM.yyyy) from those records

3. PowerApps needs to calculate the number of days between today and the date stored in the records

4. PowerAutomate needs to calculate the number of days between today the date stored and delete records that are older than 15 days and change a value in a record in a different table

 

In a test environment I have everything working with a VARCHAR in SQL that displays yyyy-mm-dd hh:mm:ss

Powerapps works nicely with it and in Power Automate I can create an Odata filter query that for all records that contain today's yyyy-mm-dd in that column and it'll delete the records from exactly 14 days ago. However, storing a date a string does not seem 'clean', but I'm no expert.

I'm in Germany, so UTC would be fine for this, but to be future proof, I'd like to understand how to display the proper date/time in my time zone.

If I understand things correctly PowerAutomate and Sharepoint work with 'points in time' that are recorded and then those points in time are translated into a time that is displayed given a specific time zone.

 

So, my question really is: what field type and format should I use when setting up the SQL server to play nice with PowerApps, PowerAutomate and Sharepoint, seeing that I want to be able to calculate dates, days and display the date/time in my timezone. (The database does not have contact with any other time zones)

 

Thank you guys.

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard