Query limited to last month?

Hi folks,

I'd like to create a query that returns tickets created

during the last calendar month. Note that this is different
from asking for tickets created during the last, say, 30 days.
For examlple, if this is September 2006, I want to create a query
in Query Builder that returns all tickets created between
August 1 2006 and August 31 2006, inclusive.

I'd like to be able to say "Created -> Before -> 

last day of previous month" and “Created → After → first day
of previous month”, but I can’t find anything that works like
this. Note that I don’t want to hard-code the dates. I want
this query to work with any month.

Any suggestions?

					Thanks,
					Bryan

Bryan Wright |“If you take cranberries and stew them like
Physics Department | applesauce, they taste much more like prunes
University of Virginia | than rhubarb does.” – Groucho
Charlottesville, VA 22901|
(434) 924-7218 | bryan@virginia.edu

Bryan -

Easiest route would probably be to extend Time::ParseDate to
differentiate between “1 month ago” and “last month” – right now, they
both translate to “this time on this day of the month 1 month ago”.

“This month” does not currently get parsed and I think it ought to be
interpreted as “00:0:00 on the first of the current month” when
PREFER_PAST is set, and “23:59:59 on the last of the current month” when
PREFER_FUTURE is set.

Once Time::ParseDate understands those phrases, you can stick them into
a time query in RT and it’ll Just Work.

As a matter of fact, it’s something I’ve been meaning to do also, but
it’s very low on the list of things slated for action during my Copious
Free Time™ so at this rate it’ll happen sometime around the next
millenium…On Fri, 2006-09-08 at 12:01 -0400, Bryan K. Wright wrote:

Hi folks,

I’d like to create a query that returns tickets created
during the last calendar month. Note that this is different
from asking for tickets created during the last, say, 30 days.
For examlple, if this is September 2006, I want to create a query
in Query Builder that returns all tickets created between
August 1 2006 and August 31 2006, inclusive.

I’d like to be able to say “Created → Before →
last day of previous month” and “Created → After → first day
of previous month”, but I can’t find anything that works like
this. Note that I don’t want to hard-code the dates. I want
this query to work with any month.

Any suggestions?

  				Thanks,
  				Bryan

/Ole Craig
Security Engineer
Team lead, customer support

303-381-3802 (main support hotline)
303-381-3824 (my direct line)
303-381-3801 (fax)

www.stillsecure.com
. . .