5

I have org-mode TODO items and I am using property to enter the entry-date via org-capture-templates. This is date of entry and not scheduled date. I have...

:PROPERTIES: :Entered: [2015-08-12 Wed 17:07] :END: Now I need to search all the item that were entered on or after certain dates. I can also use the sorting by entry timestamp.
Thanks.

4
  • 2
    For searching by property value, see the advanced searching tutorial from the manual: orgmode.org/worg/org-tutorials/advanced-searching.html For sorting by property value, I do not believe that feature is built-in.
    – lawlist
    Aug 17 '15 at 16:30
  • Thanks for pointing to some nice features. Some combination of regex leads me to desired search solutions, but not the sorting one. Perhaps it may be easy enough to write some elisp for someone.
    – aartist
    Aug 18 '15 at 21:21
  • 2
    Sadly, the sorting is not so easy. org-mode calculates certain values during the searching process and places text-properties with those values on the data that has been gathered, which is then sorted with a starting point such as org-entries-lessp. The three (3) main searching functions are already missing value calculations and text property assignments for many of the options in the org-agenda-sorting-stragegy, which is why there are threads asking why sorting doesn't seem to work. Someone on the mailing list responded to my inquiry by stating that some fixes are in the works.
    – lawlist
    Aug 18 '15 at 21:27
  • 2
    The project would entail assigning a value to the property drawer entry -- e.g., name/title of the entry; then assign it a text property that can be sorted with let's say alpha-up and alpha-down. However, the entry might be a number, in which case a different sort would be needed. Or, the entry might be a date, in which case a conversion would be needed from date to number to use ts-up and ts-down, and so on. All doable, but would take time for anyone motivated to enable those features and figure out a way to decide which value to assign.
    – lawlist
    Aug 18 '15 at 21:35
1

I suggest using org-sparse-tree (C-c /). It won't work with timestamps in a property, but you can put timestamps in the headline or on the line below and org-sparse-tree will find it.

1
  • That will not solve it. I don't want to put timestamp in headlines or as a free text. I am looking for sortable solution. So, I can see what task I entered last week, and haven't moved forward etc.
    – aartist
    Aug 18 '15 at 21:19
1

You can try swiper - it's a command that works similarly to isearch. It will automatically reveal any hidden outlines that match. The input 15 8 12 will actually match 2015-08-12 since single spaces act as wild cards.

Example screenshot:

swiper.png
(source: oremacs.com)

0

Use C-c a m

then enter:

 Entered>="<2016-06-01>"

This will search items with property "Entered" with date values exactly equals or after [2016-06-01]. It will not sort the items by newest or oldest.

1
  • 1
    org-agenda -> Match a TAGS/PROP/TODO query - For those of us with non-standard keybindings
    – Jonta
    Apr 14 '20 at 15:42
0

For sorting by property... Use M-x org-sort-entries [RET] r. Change r to R for reversing order. For more on org-sort-entries, use C-h f org-sort-entries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.