it helps reading the Documentation:
https://www.freepascal.org/docs-html/fcl/db/tlocateoptions.htmlThe LocateOptions are for Strings. How is CaseInsensitive and PartialKey supposed to work on numeric Data?
That said: For "locating" Dates the way you want, there is only the way to use Strings, since locate on Non-Strings always looks for an EXACT match.
If your DateTime as a REAL looks like "47689.2587" you will never locate it on a partial input
If your DateTime-Column is a REAL (Floating point type), additionally ship a String-Representation of your DateTime-column as a result of your Query, and do the Locate on that.
Notabene: Don't blame me (or anyone else) if the search is dog-slow....
EDIT: Something else:
Your line "search += key;" in Line 8 and 14 are duplicates. Set it once outside between Line 6 and 7.
It doesn't matter which result you get on the If-Condition in Line 7, you set "search += key;" in either case. So it's a duplicate
Next: In Line 9 and 16 you start a With block, but in the following line you fully qualify your Object again.
Either remove the With-Blocks or leave out your Object in the following line