I'm trying to get a QueryRangeFunction to return the valid string for a vendbankAccount that has not expired yet, which means
ExpiryDate = dateMin() OR ExpiryDate > today()
The existing QueryRange functions don't seem to be able to do that, but are valid examples for trying to write my own function:
[QueryRangeFunction]
public static str BankAccountNotExpiredYet()
{
return strFmt("(( %1.%2 = \"%3\") || (%1.%2 > \"%4\"))",
TableStr(VendBankAccount),
fieldStr(VendBankAccount, ExpiryDate),
DateTimeUtil::minValue(),
DateTimeUtil::utcNow());
}
This method returns
(( VendBankAccount.ExpiryDate = "") || (VendBankAccount.ExpiryDate > "8/8/2019 01:15:48 pm"))
However this doesn't filter the bank accounts that aren't expired at all.
Have spent a few hours on something that should really be trivial, any help would be appreciated,
Thanks
*This post is locked for comments