Date Compare in ESQL Query

Monday, April 9, 2018

I'm trying to do a date comparison in my custom query so that I can create a report that always reports on the last 30 days of test runs. Unfortunately it appears that every method suggested in the IBM documentation does not work in the custom query.

I've tried:

  • Using DATEDIFF(date1, date2, "days").
  • Simply doing an interval subtraction (CurrentDateTime() - TR.END_TIME) DAY
3 Replies
Monday, April 9, 2018
re: tnielsen Monday, April 9, 2018


There are two types of "entity SQL", one by IBM which is not used by Spira, and the other which is from Microsoft, which is the technology being used. So you need to refer to the Microsoft documentation instead:



Monday, April 9, 2018
re: inflectra.jimx Monday, April 9, 2018

Well, that certainly helps to know : )


Ok, for any future readers, I was able to solve my issue with the expression: 

WHERE DiffDays(TR.END_DATE, CurrentDateTime()) < 30



Friday, August 17, 2018
re: tnielsen Monday, April 9, 2018


To extend this, I'd like to report the list of test executed with the results, however only the last result which that test case was tested multiple times.

How can we get that from Entity SQL?

many thanks

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885


  • Started: Monday, April 9, 2018
  • Last Reply: Friday, August 17, 2018
  • Replies: 3
  • Views: 14550