I've not noticed this problem before.
Is there any chance that the Constant field is effectively a primary key? If so, just do a Count ( * ) because that is much faster. Or add the Constant field constraint to the WHERE clause and use the Count ( * ) function. It will probably perform much faster.
If this is only happening in this one circumstance, you could remove the index and add it back in to see if something has gotten corrupt. This often happens to non-server hosted files if they are hosted for long periods of time and may have had times when the FileMaker app had to be closed forcefully.
When you say you are having issues with tables from files that do not reside in side the local file, are these FileMaker files or ESS?
All sources are FileMaker. The Count (Constant) is really just a test, eventually it will be a sum of an invoice total.
Your suggestion of looking at the Indexes was the key.....
I turned OFF the indexing for the Market field and ran my scripts, and all counts showed as expected!!
When I went back into the source database, the Market field was turned to minimal, so FileMaker automatically reset that.