SELECT
  DATE_FORMAT(:starttime, '%Y-%m-%d %H:%i') AS StartTimestamp,
  DATE_FORMAT(:endtime,   '%Y-%m-%d %H:%i') AS EndTimestamp,
  COALESCE(c.M3,0) + COALESCE(c.M2,0) + COALESCE(c.B,0) AS Total,
  COALESCE(c.M3,0) AS Fluid_Inbound_MCM03,
  COALESCE(c.M2,0) AS Fluid_Inbound_MCM02,
  COALESCE(c.B,0)  AS Bulk_Inbound
FROM (SELECT 1) AS p
LEFT JOIN (
  SELECT
    SUM(Fluid_Inbound_MCM03 = 1) AS M3,
    SUM(Fluid_Inbound_MCM02 = 1) AS M2,
    SUM(Bulk_Inbound        = 1) AS B
  FROM jam_area
  WHERE t_stamp BETWEEN :starttime AND :endtime
) AS c ON 1=1;