Overload an operator function

When you write a new version of an operator function, follow these rules:
  • The name of the operator function must match the name of an arithmetic, text, or relational-operator function. The name is not case sensitive; the plus() function is the same as the Plus() function.
  • The operator function must handle the correct number of parameters.
  • The operator function must return the correct data type.
Tip: Although the compare() function is not strictly an operator function, when you overload the relational operators, you should prepare a corresponding compare() function, because the database server uses compare() to process queries that SELECT DISTINCT or have an ORDER BY clause.

If you define a compare() function, you must also define the greaterthan(), lessthan(), or other functions that use the compare function.