All pastes #167549 Raw Edit

Mine

public text v1 · immutable
·published 2006-09-12 02:36 UTC
rendered paste body
21:24:26 <> $query="select TimeWorked,Content as Name,Subject,Year(Tickets.LastUpdated) as yr,
                Month(Tickets.LastUpdated) as month FROM Tickets LEFT OUTER JOIN ObjectCustomFieldValues ON T
21:24:29 <> ickets.id=ObjectCustomFieldValues.ObjectId WHERE $date AND $company";
21:24:48 <> $date is a dirty hack, and $company is an integer that you go and look up.
21:25:04 <> $date="Tickets.LastUpdated>=DATE_SUB(CONCAT(SUBSTRING(NOW()+0,1,6),'01000000'),INTERVAL
                $startmonth MONTH) AND Tickets.LastUpdated<DATE_SUB(CONCAT(SUBSTRING(NOW()+0,1,6),'01000
21:25:08 <> 000'),INTERVAL $endmonth MONTH)";
21:25:51 <> $startmonth is how many months you want to subtract from the current month to get the start of
                the range, and $endmonth is how many months you want to subtract from the current month to get
                the end of the range.
21:26:09 <> So startmonth = 2 and endmonth = 1 would be all tickets from two months ago to one month ago.
21:27:41 <> ... yeah, it's a hack =)