AnsweredAssumed Answered

Find on date field funkiness

Question asked by Mike_Mitchell Expert on Mar 1, 2018
Latest reply on Mar 3, 2018 by Mike_Mitchell

Good day. I'm having a very weird problem with a script that searches on a date. Here's the script (in part):

 

 

Go to Layout [ “childMedAuthorizationBlank” (childMedAuthorization) ]

Enter Find Mode [ ]
Set Field [ child::stillRegistered; 1 ]
Set Field [ childMedAuthorization::medicationCombined; "Epipen" ]
Set Field [ childMedAuthorization::expiryDate; "<=" & GetAsText ( Get ( CurrentDate )) ]

Set Error Capture [ On ]
Perform Find [ ]
Set Error Capture [ Off ]

 

 

Here's what's happening: This is part of a nightly maintenance routine, and every night, it's finding a record where the expiry date is 1/31/2019. Obviously, that's wrong. When I run it locally, it works correctly.

 

The expiryDate field is a date field. I've reindexed the field, to no effect. Huh?

 

The only thing I can think that might be causing the issue is that the customer in question is in Canada. Is it possible that the date format might be creating the issue?

 

TIA

 

Mike

Outcomes