Well, going off the assumption that this is like a log file that tracks every hit with a date and time stamped record, try:
<font color=blue>
SELECT
CAST ( SUM( CASE WHEN (date=$yesterday) THEN 1 ELSE 0 END) AS INT) AS yesterdayhits,
CAST ( SUM( CASE WHEN (date=$today) THEN 1 ELSE 0 END) AS INT) AS todayhits
FROM hits
</font>
I don't know what database you are running, but this works on DB2, PostgreSQL, and MS SQL Server (that I have tested so far).
-- Rich