Date / Data Filter help needed

Hi.

I’m trying to filter data by dates dynamically. It displays how it should in preview, but when loading in browser there is an error which doesn’t allow the page to load even.

  1. In the database query I created a condition that it should match dates between the two GET values:

  1. The two GET values are connected to two variables

  1. In the variables I have only static values for now:

  1. It works perfectly in the preview:

  1. When loading the page in the browser, it gives this error message on the browser:

{"status":"500","message":"Undefined binding(s) detected when compiling SELECT. Undefined column(s): [sales.DateDay] query: select \"DateDay\" as \"x\", count(\"DateDay\") as \"y\" from \"sales\" where \"sales\".\"DateDay\" between ? and ? group by \"DateDay\"","stack":"Error: Undefined binding(s) detected when compiling SELECT. Undefined column(s): [sales.DateDay] query: select \"DateDay\" as \"x\", count(\"DateDay\") as \"y\" from \"sales\" where \"sales\".\"DateDay\" between ? and ? group by \"DateDay\"\n at QueryCompiler_PG.toSQL (/opt/node_app/node_modules/knex/lib/query/compiler.js:98:13)\n at Builder.toSQL (/opt/node_app/node_modules/knex/lib/query/builder.js:97:44)\n at /opt/node_app/node_modules/knex/lib/runner.js:31:36\n at /opt/node_app/node_modules/knex/lib/runner.js:277:24\n at async App._exec (/opt/node_app/lib/core/app.js:449:30)\n at async App._exec (/opt/node_app/lib/core/app.js:420:17)\n at async App.exec (/opt/node_app/lib/core/app.js:389:9)\n at async App.define (/opt/node_app/lib/core/app.js:379:9)"}

  1. When using static values in the conditions all works perfectly, so the query is right for sure. So I guess I’m making a mistake with the binding?

Does anyone have an idea what I’m doing wrong? I tried to use set value and other stuff in the server connect but nothing works. I keep getting this error.

Community Page
Last updated: