Variable Not Working After Joining

Good Evening House,

I have a small challenge here, i am new here and i just joined to table together in Metabase which i also configured a Variable to affect the table. But each time i use my filter the Diagram below is what i get.

Also Below is my script;
SELECT
si.name, si.customer, sii.item_group,
#TO_CHAR(si.posting_date, ‘DD-MM-YYYY’) AS “POST_DATE”,
si.posting_date, sii.item_name, sii.qty,sii.rate, sii.amount
FROM tabSales Invoice as si
INNER JOIN tabSales Invoice Item as sii ON si.name = sii.parent
WHERE {{date}}
LIMIT 5000

Is there anything i am missing here

Hi, can you share what settings you used for the variable (the filter)?

Okay i Used Field filter as Variable Type and i Mapped it to a Modified Date and i selected my Widget to be Date Range. Below is my script;

SELECT
si.name, si.customer, sii.item_group,
#TO_CHAR(si.posting_date, ‘DD-MM-YYYY’) AS “POST_DATE”,
si.posting_date, sii.item_name, sii.qty,sii.rate, sii.amount
FROM tabSales Invoice AS si
INNER JOIN tabSales Invoice Item AS sii ON si.name = sii.parent
WHERE {{date}}
LIMIT 5000

Its difficult to say what goes wrong here …
one idea could be not to modify your “posting_date” but use the original field as a field filter? Have you tried that?
As you convert your date to a string here (with “To_char”) metasbase might not recognise the field anymore as a proper date field.
Let me know if it works, I am sure we can figure it out :slight_smile: