Welcome Guest, Not a member yet? Register   Sign In
count how may records are AM vs. PM
#2

[eluser]Armchair Samurai[/eluser]
I'd do it like this - retrieve two records from the table, the first being AM totals and the second PM:
Code:
SELECT COUNT(*) AS `times`
FROM `foo`
WHERE HOUR(`bar`) < 12
UNION
SELECT COUNT(*)
FROM `foo`
WHERE HOUR(`bar`) >= 12


Messages In This Thread
count how may records are AM vs. PM - by El Forum - 08-04-2008, 05:56 PM
count how may records are AM vs. PM - by El Forum - 08-04-2008, 06:47 PM
count how may records are AM vs. PM - by El Forum - 08-05-2008, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB