TracQuery with dates?

21 views
Skip to first unread message

Aikido Guy

unread,
May 4, 2021, 9:24:28 AM5/4/21
to Trac Users
Hi,

I've looked at the [[TicketQuery]] help web page (Query Language) and see a number of very helpful examples. However, I can't quite figure out how to do what I want.

I have a custom field, let's call it "date", and I'd like to query out all tickets:
1) that have "date" set to today
2) that have "date" set to sometime from now until 1 week from now

I've tried:
1) [[TicketQuery(date=now..1d)]]        # want all tickets for today
2) [[TicketQuery(date=now..1w)]]       # want all tickets for today, tomorrow... up to and including 6 days from today... so, "this week"

Thank you!

Kindly,
Aikido Guy

Clemens Feige

unread,
May 4, 2021, 2:43:06 PM5/4/21
to trac-...@googlegroups.com
Aikido Guy wrote on 04.05.2021 at 15:24:
> Hi,
>
> I've looked at the [[TicketQuery]] help web page (Query Language) and
> see a number of very helpful examples. However, I can't quite figure out
> how to do what I want.
>
> I have a custom field, let's call it "date", and I'd like to query out
> all tickets:
> 1) that have "date" set to today
> 2) that have "date" set to sometime from now until 1 week from now
>
> I've tried:
> 1) [[TicketQuery(date=*now..1d*)]]        # want all tickets for today
> 2) [[TicketQuery(date=*now..1w*)]]       # want all tickets for today,
> tomorrow... up to and including 6 days from today... so, "this week"
>
> Thank you!
>
> Kindly,
> Aikido Guy


Hi Aikido

[[TicketQuery(date=today)]]

[[TicketQuery(date=1weekago)]]

See at bottom of this page:

https://trac.edgewall.org/wiki/TracQuery

Clemens

Aikido Guy

unread,
May 4, 2021, 3:58:31 PM5/4/21
to Trac Users
On Tuesday, May 4, 2021 at 2:43:06 PM UTC-4 Clemens Feige wrote:
Aikido Guy wrote on 04.05.2021 at 15:24:
> I have a custom field, let's call it "date", and I'd like to query out
> all tickets:
> 1) that have "date" set to today
> 2) that have "date" set to sometime from now until 1 week from now
>
> I've tried:
> 1) [[TicketQuery(date=*now..1d*)]]        # want all tickets for today
> 2) [[TicketQuery(date=*now..1w*)]]       # want all tickets for today,
> tomorrow... up to and including 6 days from today... so, "this week"

Hi Aikido

[[TicketQuery(date=today)]]

[[TicketQuery(date=1weekago)]]

See at bottom of this page:

https://trac.edgewall.org/wiki/TracQuery

Clemens

Thanks! I did look on the webpage that you sent (before you sent it and before I wrote the question); however I had not seen the secret sauce "today" on the webpage...

At the moment I'm assuming that I can do the following (for the dates that occur in the upcoming/next week)
[[TicketQuery(date=today..1w)]]

Or do I only need to say [[TicketQuery(date=1w)]] for the dates that are today, tomorrow, up to the next week?

Kindly,
Aikido Guy
 
Reply all
Reply to author
Forward
0 new messages