I have two variables, one is called PaidThisMonth, and the other is called OwedPast. They are both results of some subqueries in SQL. How can I select the smaller of the two and return it as a value titled PaidForPast?
The MIN function works on columns, not variables.
Use Case:
As Inline table valued UDF
Usage:
ADDENDUM:
This is probably best for when addressing only two possible values, if there are more than two, consider Craig’s answer using Values clause.