Get newest/oldest for a date related property

Discussion related to "Everything" 1.5 Alpha.
Post Reply
err_24546
Posts: 79
Joined: Wed Oct 11, 2023 1:47 am

Get newest/oldest for a date related property

Post by err_24546 »

Good day.
I wonder if there's currently any way to get the newest/oldest item/s for a date-related property, like creation or modification date?
void
Developer
Posts: 19568
Joined: Fri Oct 16, 2009 11:31 pm

Re: Get newest/oldest for a date related property

Post by void »

Please try sorting by date modified / date created.

Check the top-most / bottom-most items.
err_24546
Posts: 79
Joined: Wed Oct 11, 2023 1:47 am

Re: Get newest/oldest for a date related property

Post by err_24546 »

Yes, I'm aware of that, but I was wondering if there's a way to get only the newest/oldest results from a search?

From your response, I guess not?
void
Developer
Posts: 19568
Joined: Fri Oct 16, 2009 11:31 pm

Re: Get newest/oldest for a date related property

Post by void »

To find the latest date modified file:

sort:dm count:1




To find the earliest date modified file:

file: sort:dm-ascending count:1 no-new-results:
err_24546
Posts: 79
Joined: Wed Oct 11, 2023 1:47 am

Re: Get newest/oldest for a date related property

Post by err_24546 »

That was it. Thanks!
void
Developer
Posts: 19568
Joined: Fri Oct 16, 2009 11:31 pm

Re: Get newest/oldest for a date related property

Post by void »

Everything 1.5.0.1401a fixes an issue with
count:1
and
sort:dm-ascending


The wrong item was shown and was also lost when a change occurred.



To show the earliest date modified file:

Code: Select all

file: sort:dm-ascending dm: count:1  
Include
dm:
in your search to avoid showing items without a date modified.
err_24546
Posts: 79
Joined: Wed Oct 11, 2023 1:47 am

Re: Get newest/oldest for a date related property

Post by err_24546 »

Thanks, void!

FWIW, I think it'd be great to have two new formulas (or maybe modifiers?) like HIGHEST and LOWEST, so we can search for all items that have the highest or lowest value for a specific property.
For example:
C:\mypath\ dm:HIGHEST($dm) | LOWEST($dm)

to return all items that match the highest or lowest modified date.

Hope that pseudo query makes sense.
void
Developer
Posts: 19568
Joined: Fri Oct 16, 2009 11:31 pm

Re: Get newest/oldest for a date related property

Post by void »

I will consider formulas to gather the highest, lowest (latest,earliest) date modified from the fast date modified sort array.

Thank you for the suggestion.



I will also consider a simple highest/latest keyword for dm:
lowest is a little tricky to do as unknown date modified is usually the first/lowest item in the fast date modified sort array.
Post Reply