Custom Report Using Query

Tried to create Custom Report using Query. But can’t make it using WHERE clause.

SELECT
h.item_name as ‘Item Name’,
FROM tabItem h,
WHERE
h.country = “US” as ‘Country’;

I don’t know what is wrong.

any help guys. Thanks

Hi @FMDO,

If the country is available in Item doctype then apply it.

SELECT
    `tabItem`.`name` AS `Item:Link/Item:200`,
    `tabItem`.`item_name` AS `Item Name:Data:200`
FROM
    `tabItem`
WHERE
    `tabItem`.`country` = "US"

Reference:

Thank You!

1 Like

I appreciate. But when I tried it doesn’t work. @NCP

I’m using latest ERP system.

Hi @FMDO,

We already said like please check this.

And also check the reference.

Thank You!

1 Like
SELECT
    h.item_name as 'Item Name',
    h.country as 'Country'
FROM
    tabItem h
WHERE
    h.country = 'US';

if it didn’t work please show what kind of error it give you