Filter posting_date 2 times in script report

i try to filter posting_date field 2 times in the script report but there is no date just one period

case when si.posting_date >= {date_from}  and si.posting_date <= {date_to}  then sum(sii.qty) else 0 end as qty,
 case when si.posting_date >= {date_from}  and si.posting_date <= {date_to}   then sum(sii.base_net_amount) else 0 end as amount,
 case when si.posting_date >= {date_from2}  and si.posting_date <= {date_to2}  then sum(sii.qty) else 0 end as qty2,
 case when si.posting_date >= {date_from2}  and si.posting_date <= {date_to2}  then sum(sii.base_net_amount) else 0 end as amount2

Hi @Osk,

Use BETWEEN in query and try it.

Here example:

CASE WHEN si.posting_date BETWEEN '{date_from}' AND '{date_to}' THEN SUM(sii.qty) ELSE 0 END AS qty,
CASE WHEN si.posting_date BETWEEN '{date_from}' AND '{date_to}' THEN SUM(sii.base_net_amount) ELSE 0 END AS amount,
CASE WHEN si.posting_date BETWEEN '{date_from2}' AND '{date_to2}' THEN SUM(sii.qty) ELSE 0 END AS qty2,
CASE WHEN si.posting_date BETWEEN '{date_from2}' AND '{date_to2}' THEN SUM(sii.base_net_amount) ELSE 0 END AS amount2

Please set your according.

Thank You!