Help with Execute SQL to count unique values
I want to calculate / count the number of unique email addresses in my file.
I defined a calculation field, c_UniqueEmails (number result) with the calculation shown below:
ExecuteSQL ("SELECT COUNT (DISTINCT Email_User) FROM USERS_XYZ" ; "" ; "")
I've tried this with various Storage options. They all return "?" as a result.
Email_User is a text field / indexed.
The name of the FileMaker file is USERS_XYZ. The name of the TO is USERS. If I use USERS instead of USERS_XYZ, the progress bar appears but nothing happens. I need to force quit. If I use USERS_XYZ, the calculation returns a "?"
The table has almost 70,000 records.
What might I be doing wrong?