I have a crosstab report where I tally up cluster usage by login name by date. My crosstab column is the DATE part of a timestamp, and the report looks great, except...
The crosstab columns do not come out in chronological order. Is there some way that I can tell myDBR to sort my crosstab columns in order?
My report code:
CREATE PROCEDURE
()
_
BEGIN
select 'dbr.crosstab', 4;
select 'dbr.crosstab.title', 'Total';
select 'dbr.hdr', 2;
select 'dbr.sum', 5;
select 'dbr.hsum', 5;
select 'dbr.nosort';
select o.olive_host_ip as host, o.olive_cluster as cluster,
o.login_name as login, DATE(o.create_date) as date, count(*) as minutes
from olive_stats.olive_stats o
where DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= o.create_date
group by host, cluster, login, date;
END