SELECT DISTINCT
IF(CAL_QUAL.CAL_BASE_MATRIX
.Blanks_Coil = “Coil”,
IF(ISNULL(Subquery_1.TS_Result_Type), ‘NO’, Subquery_1.TS_Result_Type),
Subquery_1.TS_Result_Type) as Subquery_1.TS_Result_Type
From …
WHERE (Subquery_1.Result_Type <> ‘NO’)
I’m having trouble with the syntax, I believe. This syntax is so confusing. Sometimes you use parenthesis. Sometimes you don’t. I’m used to VBA where the syntax is the same for everything, and the script flows sequentially like a thought process. I simply want to:
-
Check the values of a column called “Blanks_Coil”. If the value of “Blanks_Coil” = “Coil” Then
-
Check a column called “TS_Result_Type”. If the value of “TS_Result_Type” is null, set the value of “TS_Result_Type” = “NO”, Else leave the current value
-
Else if the value of “Blanks_Coil” <> “Coil”, leave the current value of “TS_Result_Type”
-
Once that is done, I only want to include values Where “TS_Result_Type” <> “NO”