PDA

View Full Version : DateTime filter error


CraigYellick
May 31st, 2022, 08:56 AM
An app that worked perfectly well for a long time is now throwing an exception no matter what date is specified.

This criteria:

qry.AddCriteria("FLDTKTOPENDATETIME", OperatorEnum.opGreaterThanOrEqual, filterDate)

Throws:

Status 2000: General Error Occurred FAILURE
Result message: ??? ?? ????? ??? ???? DateTineValue found does not match field type. The value:4/20/2022
50000: The Data is not Correct to it Type

For any date tested. Again, this code has been working fine for a long time.

-- Craig

Support Team
May 31st, 2022, 09:48 AM
Thanks for posting. The fact that it has been working fine for you and stopped makes it look like an external, OS maybe, change that somehow affect things, though it's not clear what this might be.

In any case I'd add that this field expects a date-time value, unlike a data only value.

In case the above does not help, please zip the content of your \Logs folder and email it back to us, maybe something additional is logged there.

Hope this helps.

CraigYellick
May 31st, 2022, 09:50 AM
The filterDate variable is a date-time type. Nothing has changed that I know of. Will send the logs.

CraigYellick
June 1st, 2022, 10:01 AM
Solution if anyone ends up reading this thread: the default .net date format uses slashes dd/mm/yyyy. Something changed in the API recently and now dashes are required, dd-mm-yyyy.