select
sum(one_if_within_n_days(confirmed_date,1)) as n_o_in_last_24_hours,
sum(one_if_within_n_days(confirmed_date,7)) as n_o_in_last_7_days
from ec_orders_reportable
select
sum(one_if_within_n_days(issue_date,1)) as n_g_in_last_24_hours,
sum(one_if_within_n_days(issue_date,7)) as n_g_in_last_7_days
from ec_gift_certificates_purchased
select
sum(one_if_within_n_days(issue_date,1)) as n_gi_in_last_24_hours,
sum(one_if_within_n_days(issue_date,7)) as n_gi_in_last_7_days
from ec_gift_certificates_issued
select
sum(one_if_within_n_days(shipment_date,1)) as n_s_in_last_24_hours,
sum(one_if_within_n_days(shipment_date,7)) as n_s_in_last_7_days
from ec_shipments
select
sum(one_if_within_n_days(refund_date,1)) as n_r_in_last_24_hours,
sum(one_if_within_n_days(refund_date,7)) as n_r_in_last_7_days
from ec_refunds