Date Compare in ESQL Query

Monday, April 9, 2018 3:50:41 PM

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
2 Replies
Monday, April 9, 2018 4:53:11 PM
Avatar
re: tnielsen on Monday, April 9, 2018 3:50:41 PM

Hi

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:

https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/entity-sql-reference

Regards

Jim

Monday, April 9, 2018 5:23:08 PM
Avatar
re: inflectra.jimx on 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

 

Thanks!

Statistics
  • Started: Monday, April 9, 2018 3:50:41 PM
  • Last Reply: Monday, April 9, 2018 5:23:08 PM
  • Replies: 2
  • Views: 256