are you on a layout based on the STAFF table occurrence for this conditional format?
SQL comparisons are CASE-SENSITIVE. "a" != "A". You can sometimes get around this:
WHERE LOWER(Staff_Name) = ?"
""; "" ; Lower(Staff::Staff_Name)
Yes the functions in SQL and FM are named the same and perform the same action. I used lower here, but upper would accomplish the same thing. Perhaps that helps?
Hello, thanks for the reply. I am not on a layout based on the STAFF table. My example might have been confusing because I slimmed down the parameter part. The parameter is being put in there by another SQL statement which returns a single "staff name". I have tested that part and it works without any issues.
You could replace the parameter with "steve" in my example.
Thanks as always for the reply. It doesnt seem to be an issue with case because its returning too many results, rather than no results. In fact it seems that no matter what string I pass in the parameter, all the possible color options are returned.
So to further my example, I have two records in my staff table, one has the staff name "preston" and color "blue", the other has the staff name "steve" and color "orange".
When I run this execute sql statement, the results is:
ExecuteSQL("SELECT ColorCode FROM STAFF WHERE Staff_Name = ?"; ""; ""; "preston")
When I run the below SQL statement, the results are also:
ExecuteSQL("SELECT ColorCode FROM STAFF WHERE Staff_Name = ?"; ""; ""; "p")
It seems no matter what I put in there, it returns all the possible results.
Lol - wow I feel like deleting this post now. I must have hit my scroll wheel somehow and changed my Staff_Name field to a number field some how.
Time to get some more sleep I guess.
I am not on a layout based on the STAFF table.
ExecuteSQL() itself is context independent, but not the parameters that you pass into it like you do. If you reference a field then that field will be evaluated from the context that you happen to be on in order to try and read its value.