Hi all,
I'm creating a SQL statement for ERP Plex database. And I'm struggling with adding parameters with ? in WHERE clause. Parameter is very simple, period in a form YYYYMM, so if I type manually T0.Period=202206 (it works also in text mode '202206') everything is fine, I get hundreds of records. Then I put T0.Period=? and I reference it to the field on another sheet, where in that field I type manually 202206 as a number and as a text, but SQL statement returns zero records, no errors. I tried so many combinations even to convert field like CAST(T0.Period as INT) or CAST(T0.Period as VARCHAR) but just can't get it work with a parameters. I have similar issue with a Date fields, but even stranger is that some SQL's accept date parameter and some don't, but couldn't figure it out what is different, date field formats were exactly the same and parameter field had the same value as well. Any ideas or suggestions?
Appreciate it?
I'm creating a SQL statement for ERP Plex database. And I'm struggling with adding parameters with ? in WHERE clause. Parameter is very simple, period in a form YYYYMM, so if I type manually T0.Period=202206 (it works also in text mode '202206') everything is fine, I get hundreds of records. Then I put T0.Period=? and I reference it to the field on another sheet, where in that field I type manually 202206 as a number and as a text, but SQL statement returns zero records, no errors. I tried so many combinations even to convert field like CAST(T0.Period as INT) or CAST(T0.Period as VARCHAR) but just can't get it work with a parameters. I have similar issue with a Date fields, but even stranger is that some SQL's accept date parameter and some don't, but couldn't figure it out what is different, date field formats were exactly the same and parameter field had the same value as well. Any ideas or suggestions?
Appreciate it?