cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Record Displays Incorrect Date

For some strange reason, PowerApps is displaying the incorrect date for a record that I have.  Here's the formula that I'm using to create a record. 

 

 

 

Patch('[dbo].[alseInspections]', Defaults('[dbo].[alseInspections]'),{ AlseCard: AlseCardSel.Selected.Value, AlseSn: Text(NextAlseNum), ItemType: ItemType.Selected.Value, Location: InspLocation.Selected.Value, Base: NewBase.Selected.Value, Unit: NewUnit.Selected.Value,  Status:Status.Selected.Value, TailNumber: NewTailNumb.Selected.Value,InspectInterval: Value(InspecIntvNew.Selected.Value), BuildUpDate: Now(), LastInspectionDate: Now(), NextInspect: DateValue(NextInspNew.Text), NextAnnual: DateValue(NextAnnNew.Text)});

 

This formula adds a new inspection record to the Inspections table in my SQL database. Upon creation of a new record, the BuildUpDate and LastInspection columns will record the current date and time using the Now() formula.  The NextInspect, adds the inspection interval to the date in order for the user to know when the next date is for an inspection.

 

 

The column value is set to datetime in SQL . The column in question is the LastInspectionDate. For some reason, it displays the date of the record a full 2 months behind from the date that is in SQL. This is not good because the record will display an incorrect date for when an item is due for inspection. 

 

I understand that there has been some issues with datetime but this one takes the cake. Any help would be appreciated.

 

My session ID is below.

Session ID: 599acc7e-9fa7-82d5-ccc6-a656f53e016b

 

 

Thanks,

Brendon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps Staff AndyPennell
Power Apps Staff

Re: Record Displays Incorrect Date

My guess is you are parsing dates in the wrong locale, for example "7/5/2017" vs "5/7/2017" which in this case are about two months apart.

 

When using DateValue, be sure to specify the locale you expect the date to be in. It will default to whatever locale you are running in, which may not be the same locale you saved it in.

View solution in original post

2 REPLIES 2
Highlighted
Power Apps Staff AndyPennell
Power Apps Staff

Re: Record Displays Incorrect Date

My guess is you are parsing dates in the wrong locale, for example "7/5/2017" vs "5/7/2017" which in this case are about two months apart.

 

When using DateValue, be sure to specify the locale you expect the date to be in. It will default to whatever locale you are running in, which may not be the same locale you saved it in.

View solution in original post

Re: Record Displays Incorrect Date

Not so much....

 

It turns out that there was a foreign key issue that I had in my dB.  That issue has been resolved, but thanks for the heads up. 

Helpful resources

Announcements
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.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

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 (9,076)