"There is an error in the syntax of the query."
Not all that helpful I'm afraid..
First thing I see is a typo - you've entered "WHARE" where you want "WHERE".
WHERE is not WHARE
~GetSQLFieldTable may be ~GetSQLTableName
What does CF do? Why doesn't it contain Quote() function if you always use with it?
The CF:s uses the GetFieldName() function to gather either the table name part (left of ::) or field name part (right of ::) of the full field name, to make it easy and "renaming safe".
The external quotes are there because I can't predict whether I will be using that in all future uses of the CF:s. And when coming back to the calculation when some time has passed it is easier to get the grasp of how it works.
Best regards Magnus Fransson.