Parameterized query from database connector returns a blank list

0
I’m using the Mendix Marketplace - Database Connector to connect to an external database in order to fetch some data. My queries work when I use a static query or run a query manually. However, when I parameterized query (with verified parameters) the query returns an empty list while there should be rows. Has anyone using this module experienced this issue?   Query – SELECT vehicle_id, activity, SUM(OEC) as OEC, SUM(EAC) as EAC, SUM(ACT) as ACT, SUM(OEC_ACT) as OEC_ACT, SUM(ETC) as ETC FROM vehicle_cost WHERE vehicle_id={1} AND project={2} AND date_timestamp BETWEEN {3} AND {4} GROUP BY activity; Hardcoded query – SELECT vehicle_id, activity, SUM(OEC) as OEC, SUM(EAC) as EAC, SUM(ACT) as ACT, SUM(OEC_ACT) as OEC_ACT, SUM(ETC) as ETC FROM vehicle_cost WHERE vehicle_id=602 AND project='10712 ACS-64 TSSSA LOC CS' AND date_timestamp BETWEEN '2018-01-03' AND '2021-05-20' GROUP BY activity;  
asked
2 answers
1

Hi pratik , 

Please add is null to your query , since in where condition you will not pass value to all parameter everytime so some attributes will be empty , it cause the query to return empty list for you

answered
0

The issue is resolved.

It was the problem with date formats and parameter not pointing to correct variable.

answered