Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating a Reference String
Message
 
 
To
07/02/2008 10:50:13
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01289953
Message ID:
01290761
Views:
9
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform