Revenue by Card TypeheadingSELECT DISTINCT from_unixtime(date_orig,"%Y") as yearmonth from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id=%%DEFAULT_SITE%% and A.billing_status=1 and (A.refund_status='' OR A.refund_status is null)ORDER BY yearmonth ASC0Year:yearmonthtruetruetruefalsefalseselect DISTINCT UCASE(B.card_type) as card_type, count(A.id) as quan, sum(A.total_amt) as amt, from_unixtime(A.date_orig,'%Y') as yearmonth from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id = %%DEFAULT_SITE%% and B.site_id = %%DEFAULT_SITE%% and (A.refund_status='' OR A.refund_status is null)GROUP BY B.card_type ORDER BY amt ASC30DateyearmonthfalsefalseCard Typecard_typeInvoicesquantrueAmountamtdol,2truedol,2select UCASE(B.card_type) as card_type, sum(A.total_amt) as amt, from_unixtime(A.date_orig,'%Y') as yearmonth from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id = %%DEFAULT_SITE%% and B.site_id = %%DEFAULT_SITE%% and (A.refund_status='' OR A.refund_status is null)GROUP BY B.card_type ORDER BY amt ASCheadingSELECT DISTINCT from_unixtime(date_orig,"%M, %Y") as yearmonth, from_unixtime(date_orig,"%Y-%m") as ordby from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id=%%DEFAULT_SITE%% and A.billing_status=1 and (A.refund_status='' OR A.refund_status is null)ORDER BY ordby ASC0Month: yearmonthtruetruetruefalsefalseselect DISTINCT UCASE(B.card_type) as card_type, count(A.id) as quan, sum(A.total_amt) as amt, from_unixtime(A.date_orig,'%M, %Y') as yearmonth, from_unixtime(date_orig,"%Y-%m") as ordby from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id = %%DEFAULT_SITE%% and B.site_id = %%DEFAULT_SITE%% and (A.refund_status='' OR A.refund_status is null)GROUP BY B.card_type ORDER BY ordby30DateyearmonthfalsefalseCard Typecard_typeInvoicesquantrueAmountamtdol,2truedol,2select UCASE(B.card_type) as card_type, sum(A.total_amt) as amt, from_unixtime(A.date_orig,'%M, %Y') as yearmonth from %%AGILE_DB_PREFIX%%invoice A
inner join %%AGILE_DB_PREFIX%%account_billing B on (A.account_billing_id=B.id) A.site_id = %%DEFAULT_SITE%% and B.site_id = %%DEFAULT_SITE%% and (A.refund_status='' OR A.refund_status is null)GROUP BY B.card_type ORDER BY amt