@smohler - Here is a link to a pkg containing examples that parse your file for count, as well as the original query. Hopefully this reference can rectify whatever is throwing your SQL/file open error.
The syntax for retrieving just the count is as follows:
“SELECT COUNT (*) AS TotalQualifiedData FROM [sql_dummy_file#csv] WHERE [baz] > 10.0 AND [baz] <= 100.0”
Using a file open command, you essentially instantiate a temporary field that will receive the total number of data fields that match your criteria. In this example case, we are using “TotalQualifiedData” as a temporary header, where the read variable t_intTotalData receives this count value after reading from the file.