cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MattTaylor
Helper II
Helper II

View sorted by a date and a date/time field not sorting correctly

Dear PowerApps Community,


I've been having an issue with a view that sorts by two fields, the first is a date only field and the second is a date/time field. I appreciate that behind the scenes the date only field will have a time component but in theory this should be the same for all records, right?

I am sorting first by Date Completed (actualdate) and then by Date Created, my expectation would be for 3 or 4 records with the same Date Completed, the sort order should effectively be just Date Created. This is instead what I see:
screenshot1.png

You can see for the 8th March the sort is incorrect on the Date Created (far-right column). 

Microsoft support tell me that this is intended behaviour and on a support environment they showed me this: screenshot2.png

It shows different second components for my 'date only' field. They have told me that the only option is to create a pre-create plugin to set the second component to zero. This seems very odd to me, has anyone else had any experience with this or any similar issues?

 

Thanks in advance,


Matt

 

 



3 REPLIES 3
dpoggemann
Memorable Member
Memorable Member

Hi @MattTaylor ,

 

That is not expected behavior in my opinion and I am in a demo tenant to try and recreate the situation and I am unable to do so...

 

I did the following:

1. Added a "Date Only" field to the Account called Test Date

2. Modified the Active Accounts view to sort on this date first and then create date second

3. Tried multiple updates to the fields on the Test date and the sorting always stayed appropriate for every test.

4.  Created a Power Automate flow to extract the Test Date and format the output to a variable and the time is always set to 12:00:00 AM which is what I expected.

dpoggemann_0-1624708917652.png

 

My question is did you convert this field from a Date / Time to a Date Only field?  I think I have heard of issues when this is done where it maintains the time part on the fields for existing records...

https://www.inogic.com/blog/2015/07/updating-date-values-of-existing-records-after-modifying-the-dat...

 

Hope this helps.  Please accept if answers your question or Like if helps in some way.

 

Thanks,

 

Drew

MattTaylor
Helper II
Helper II

Hi Drew, 

Thanks for your reply, that's a good point and something I'll have to check - is there any way to tell if the field was changed at some point as it was before my time if it was?

 

It seemed bonkers to me that this was "by design", so I'm glad someone else agrees! 

dpoggemann
Memorable Member
Memorable Member

Hi @MattTaylor,

 

Sorry I don't know how to check if the field was changed...

 

Maybe Microsoft has a way to check this?  Another option would be if you had an initial backup saved somewhere that you could restore to another environment but assume that is not the case...

 

Thanks,


Drew  

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,241)