Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating a Reference String
Message
 
 
À
07/02/2008 10:50:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01289953
Message ID:
01290761
Vues:
10
Hi Matt,

I'm glad it works for you.

>Thanks very much - that looks just the ticket.
>
>>You have to pad them from the left to the same length to make comparable. Assuming that reference cannot have leading spaces and max len of it is 30 characters
>>
>>
>>SELECT
>>    LTRIM(MAX(RIGHT(REPLICATE(' ',30) + RTRIM(ref),30))) As MaxRef
>>...
>>
>>
>>>
>>>AAAA is greater than ZZZ because it has more characters in it.
>>>
>>>My client sees it as being similar to 1111 being bigger than 999.
>>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform