I am writing a stored procedure and in the table I use there are two currency codes per record (Buy Currency and Sell Currency). In the stored procedure I need the results to reflect as Currency 1 and Currency 2 based on alphabetical order of the first letter of the currency code. Currency 1 should always be the currency where the first letter of the currency code is the highest up in the alphabet E.g. if the two currencies on the record is EUR and USD, Currency 1 should reflect as EUR and Currency 2 as USD (as 'E' is higher as 'U').
Another example is for instance where the two currencies are USD and ZAR. In this case Currency 1 should reflect as USD and Currency 2 as ZAR.
When BuyCcy first letter is higher up alphabetically Then BuyCcy
End As Currency 1
Any help will be appreciated how to code this alphabetical logic.