cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sofie_D
Level 8

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
JRaasumaa
Level 10

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
JRaasumaa
Level 10

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

Sofie_D
Level 8

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,784)