Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira JQL query date range problem

Kunal Mehta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2023

As per my understanding the following 2 queries should give exactly the same results:

1. project = "my project" AND resolved is not EMPTY AND resolved >= 2023-01-09 AND resolved < 2023-01-14

2. project = "my project" AND resolved is not EMPTY AND resolved >= 2023-01-09 AND resolved <= 2023-01-13

 

But they are giving slightly different results. To be clear, the 1st query is correctly giving the tasks resolved on 13th January as well, while the second query is not. Why?

Any help will be much appreciated.

 

1 answer

1 accepted

5 votes
Answer accepted
Ste Wright
Community Champion
January 14, 2023

Hi @Kunal Mehta 

Resolved is not just a Date field - it's a Date/Time field.

---

When you search for...

resolved <= 2023-01-13

...Jira reads this as a Date/Time value - YYYY-MM-DD hh:mm. If you do not specify a time, Jira defaults this to 00:00 (i.e the first minute in a day):

resolved <= '2023-01-13 00:00'

So whilst ">=" works fine as it's 00:00 or later - for "<=" it's 00:00 or earlier - i.e 13/01/2023 at 00:00, then 12/01/2023 or earlier.

---

You have two options here - either use "<"....

resolved < 2023-01-14

which is really '2023-01-14 00:00' - or specify the time to be the end of the 13th...

resolved <= '2023-01-13 23:59'

---

Let us know if this helps!

Ste

Kunal Mehta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2023

This clarifies everything. Thank you so much!

Like Ste Wright likes this

Suggest an answer

Log in or Sign up to answer