DISCLAIMER: This might be more of a SQL question than an Ignition one.
I have a table on Perspective and I want to bind its data property to a conditional and parameterized query. My view (shown below) has a multistate button and two date entry fields. Depending on the value of the multistate, I want to make the query check different columns for the records in the date range.
I want to use the “MEL_Cal” named query shown below. I’ve setup the parameters and am aware of the “:ParameterName” syntax. What I can’t figure out is how to leverage :FilterMultistate to decide whether to use column “Last_CAL” or “CAL_Due” for the appropriate date range. Can anyone help with the syntax? I assume I need some CASE WHEN THEN in there.