I am trying to use 2 values in a chart and have the following in my setup
$current_date = "2020-08-18"; //date('Y-m-d');
$this->src('config')->query("select sum(Amount) from history")->pipe($this->dataStore("mydata"));
$this->src('config')->query("select count(distinct(SID)) from other_history where `Date` < '?'",[$current_date])->pipe($this->dataStore("checkedsm"));
$this->src('config')->query(DB::table('sales')->count())->pipe($this->dataStore("totsm"));
mydata and totsm are correctly picked and used in the chart. Checkedsm however is returning a null value (zero.) When I copy and paste the SQL in phpmysql, it gets the value 18 from the database.
I can't figure out what is wrong with the code.