Query report - Item Wise summary

We are trying to get item wise summary report from specific times within a specified date. The query below is not working.

sii.item_code AS “Item Code”,
sii.item_name AS “Item Name”,
SUM(sii.qty) AS “Total Quantity”,
SUM(sii.amount) AS “Total Amount”
tabSales Invoice Item sii
tabSales Invoice si ON sii.parent = si.name
si.posting_date BETWEEN %(start_datetime)s AND %(end_datetime)s
AND si.docstatus = 1
sii.item_code, sii.item_name

Pls share the issue you are having it will be much more easier to get answers on the right direction!

actually we want get item summary details from sales invoice from specific time to specific time.

example :item wise summary for the placed invoiced on particular date 10.30 AM to 12.15 PM.


Let’s suppose you wanna filter the time range on an specific date!

You will need one date field and 2 time fields on the filters

where posting_date = %(date_filter)s
  And posting_time between %(start_time)s and %(end_time)s

Actually should be filtered by time range. Usually the date range is working.
not only for specific single date it may two dates. should be filtered by time range with date.

So, just add the filters for time range!

It should work!