cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

Using DateTime with SQL

I'm working with an SQL database for the first time and having some trouble with showing my datetime fields in PowerApps.

I have a date in my database saved as varchar(50) with "17/05/2018 15:52"

When I display this as Text(DateTimeValue(ThisItem.DateIssue), "[$-en-US]dd/mm/yyyy")It displays as "05/05/2019"

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Using DateTime with SQL

Wrap the date with a DateValue and a different timezone.

 

 

DateValue(YourFieldHere.Text,"fr")

You can then convert it around to the regular format like:

 

Text(DateValue(YourFieldHere.Text,"fr"),"dd/mm/yyyy")

 

The bigger question is why are you storing your date values as a text field? Can that be changed?

 

View solution in original post

2 REPLIES 2
Highlighted
Memorable Member
Memorable Member

Re: Using DateTime with SQL

Wrap the date with a DateValue and a different timezone.

 

 

DateValue(YourFieldHere.Text,"fr")

You can then convert it around to the regular format like:

 

Text(DateValue(YourFieldHere.Text,"fr"),"dd/mm/yyyy")

 

The bigger question is why are you storing your date values as a text field? Can that be changed?

 

View solution in original post

Highlighted
Responsive Resident
Responsive Resident

Re: Using DateTime with SQL

Thanks, that works.

 

And yes I know I shouldn't store it as text, unfortunately I didn't make the database and it's too late to change it now.

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,148)