Bounty Cap

I dont know the place – Error SQL Question (utilizing MariaDB)


So, right here is my question. I’m utilizing MariaDB for database. I’m comparatively new on this sql database. The error that was given is You've gotten an error in your SQL syntax; verify the guide that corresponds to your MariaDB server model for the appropriate syntax to make use of close to 'SUM(IF(t1.posting_date BETWEEN '2021-01-01' AND '2021-01-31', t2.base_net_amo...' at line 1. I already tried a number of issues and nonetheless nothing.

choose t2.item_code, t2.item_name, t1.no_jo, SUM(IF(t1.posting_date BETWEEN '2021-01-01' AND '2021-01-31', t2.stock_qty, NULL),SUM(IF(t1.posting_date BETWEEN '2021-01-01' AND '2021-01-31', t2.base_net_amount, NULL)),
SUM(IF(t1.posting_date BETWEEN '2021-02-01' AND '2021-02-28', t2.stock_qty, NULL),SUM(IF(t1.posting_date BETWEEN '2021-02-01' AND '2021-02-28', t2.base_net_amount, NULL)),
SUM(IF(t1.posting_date BETWEEN '2021-12-01' AND '2021-12-31', t2.stock_qty, NULL),SUM(IF(t1.posting_date BETWEEN '2021-12-01' AND '2021-12-31', t2.base_net_amount, NULL)),
SUM(t2.stock_qty), SUM(t2.base_net_amount) 
from `tabBAST` t1, `tabBAST Merchandise` t2 
the place t2.dad or mum = t1.identify and t1.firm = %s and t1.transaction_date between %s and %s and t1.docstatus = 1 
group by t2.item_code;

Can somebody assist me discover the place is the issue ? Thanks

Exit mobile version