Simple stats query?

I need a way to generate a simple monthly report on the number of tickets
created vs. the number of tickets completed on time.

I understand there are some pretty complex statistical packages for RT, but I
don’t need anything like that. Can anybody give me some ideas where to look
for information about creating a query that does:

(the number of tickets resolved before they became due between [date-start]
and [date-end]) divided by (the number of tickets created between
[date-start] and [date-end])

Perfection is just a word I use occasionally with mustard.

Atom Powers
Systems Administrator
Pyramid Breweries Inc.
206.682.8322 x251