Try ERPNext Buy Support Partners Foundation

Custom field in Query report

I’m trying to call a custom field in a query report, but I’m getting an error.

I have a field called damaged_bottles_qty in the stock entry and when I try and use it in a query report I get the following error.


MariDB doesn’t support syntax which you have applied in Query…

Please check at command line execution in MariaDB before apply in Query Report.

Can You share your query which can help others to help you out.


Try like this syntax.


I’m sorry I can’t see this clearly. Where did I go wrong?

I was trying to follow this syntax:

hey @tefobw there is one mistake you have forgotten to add comma in the query so you query will be something like this
tabStock Entry Detail.item_code AS ‘Item:Link/Item:150’,
tabStock Entry.damaged_bottles_qty AS ‘Damaged:Int:100’
tabStock Entry Detail,
tabStock Entry
tabStock Entry.damages = 1

I have just amended single quote which is not available on the keyboard
    `tabStock Entry Detail`.it`Preformatted text`em_code AS `Item:Link/Item:150`,
    `tabStock Entry`.damaged_bottles_qty AS `Damaged:Int:100`
    `tabStock Entry Detail`,
    `tabStock Entry`
    `tabStock Entry`.damages = 1