I have a working query that connects to a remote Oracle database through the Oracle 11g Client. To incorporate a parameter based on an alias I used this query as a subquery with the parameter in the main query. I don't see anything the matter - though something obviously is - so before I grind on this for another hour I thought I would pose the code to the experts:

```
SELECT *
FROM
  (
  SELECT "UNITS"."UnitNumber", "UNITS"."ModelYear", "UNITS"."Make", "UNITS"."Model", "UNITS"."Class3", 
    "UNITS"."Class3Description", "UNITS"."TechnicalSpecification", SUBSTR("UNITS"."TechnicalSpecification", 13, 1) AS "FSC",
    "UNITS"."OwnerDepartment", "UNITS"."UnitStatus",
    CASE WHEN "UNITS"."Class3" = '1' AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'F' THEN 'Y'
      WHEN ("UNITS"."Class3" = '10' OR "UNITS"."Class3" = '15') AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'U' THEN 'Y'
      WHEN "UNITS"."Class3" = '11' AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'D' THEN 'Y'
      WHEN ("UNITS"."Class3" = '2' OR "UNITS"."Class3" = '8' OR "UNITS"."Class3" = '18') AND 
    SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'C' THEN 'Y'
      WHEN ("UNITS"."Class3" = '3' OR "UNITS"."Class3" = '9' OR "UNITS"."Class3" = '17') AND 
    SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'B' THEN 'Y'
      WHEN "UNITS"."Class3" = '16' AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'S' THEN 'Y'
      WHEN ("UNITS"."Class3" = '13' OR "UNITS"."Class3" = '4') AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'L' THEN 'Y'
      WHEN ("UNITS"."Class3" = '12' OR "UNITS"."Class3" = '14') AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'G' THEN 'Y'
      WHEN ("UNITS"."Class3" = '19' OR "UNITS"."Class3" = '20') AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'R' THEN 'Y'
      WHEN "UNITS"."Class3" = '5' AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'E' THEN 'Y'
      WHEN "UNITS"."Class3" = '6' AND SUBSTR("UNITS"."TechnicalSpecification", 13, 1) <> 'H' THEN 'Y'
      ELSE ''
      END AS "MISMATCH"
  FROM "MFIVE"."VIEW_ALL_UNITS" "UNITS"
  WHERE  "UNITS"."OwnerDepartment" LIKE '580' AND "UNITS"."UnitStatus"='A'
  ) "U"
WHERE  "U"."MISMATCH" = {?Mismatch}
ORDER BY "U"."UnitNumber"

```

When I attempt to run this query I recieve a "Failed to retrieve date from the database" error, ORA-00936: missing expression.

For the life of me I can't see what the problem is. Any assistance will be appreciated.