select rxdate, count(distinct hn) as cases, count(distinct vn) as times, count(icode) as items, sum(sum_price) as total_price
from opitemrece
where rxdate between "2011-01-01" and "2011-09-30" and icode like "1%" and vn is not null
group by rxdate
order by rxdate
CR: พี่ๆ ใน บอร์ด