Try SELECT COUNT(*) AS Order.count FROM Orders WHERE Orders.Sent=0; and access it through the field alias