>>>Use DTOS instead of DTOC. I think DTOC function is not good as part of index expression as it's settings dependent.
>
>Thanks. We'll keep that in mind as a future project because it may cause a lot of changes in code, but I don't think it's the main cause here because we set all the environment in one place and every form, class, etc. use the same setting. So, SET CENTURY and SET DATE (for example) are only set once and never touched afterward.
I'm pretty sure it is the main cause of your issues. If you have expression which is not guaranteed to always remain the same, you're asking for troubles.
If it's not broken, fix it until it is.
My Blog