Tente converter em texto SELECT SUM(quantidade) From notafiscal Where DATE_FORMAT(Data_compra, '%T') Between '13:00:00' and '17:30:00'
SELECT SUM(quantidade) FROM notafiscal WHERE DATE_FORMAT(Data_compra, '%T') BETWEEN '13:00:00' AND '17:30:00'
Tente converter em texto: