All pastes #168045 Raw Edit

Miscellany

public php v1 · immutable
·published 2006-09-12 17:14 UTC
rendered paste body
  $query = "   SELECT d.Name\n"          ."        , ROUND(SUM(te.Price * te.Quantity), 2) AS [$title]\n"          ."\n"          ."     FROM Item i\n"          ."\n"          ."LEFT JOIN Department d        ON d.ID = i.DepartmentID\n"          ."LEFT JOIN TransactionEntry te ON te.ItemID = i.ID\n"          ."LEFT JOIN [Transaction] t     ON te.TransactionNumber = t.TransactionNumber\n"          ."LEFT JOIN Batch b             ON t.BatchNumber = b.BatchNumber\n"          ."\n"          ."    WHERE b.ClosingTime >= '".date("Y-m-d", $from_time)."'\n"          ."      AND b.ClosingTime < '".date("Y-m-d", $to_time+ONE_DAY)."'\n"          ."\n"          ."    GROUP BY ALL d.Name\n"          ."    ORDER BY d.Name";