SELECT count(czytelnikow) AS 'Odwiedziny'
FROM (
SELECT statistics.type as czytelnikow FROM statistics, items
WHERE items.itemnumber = statistics.itemnumber
and DATE(statistics.datetime)>=<<Data od (yyyy-mm-dd)|date>>
and DATE(statistics.datetime)<=<<Data do (yyyy-mm-dd)|date>>
and `items`.`homebranch` = <<Biblioteka|branches>>
and `statistics`.`borrowernumber` IS NOT NULL
GROUP BY DATE(statistics.datetime), statistics.borrowernumber )AS t1