Prev: PIVOT data
Next: Change Tracking Help?
From: Andrew Morton on 26 May 2010 11:18 scott wrote: > I'm in a bind because we may need to add a 6' ( 6 foot) item at some > point and I won't know whether to display a alpha-numeric value with > the inch sign or a foot sign. That'll be a 72" item then? -- Andrew
From: scott on 26 May 2010 14:08 Thank you much. "Plamen Ratchev" <Plamen(a)SQLStudio.com> wrote in message news:ffuov59hpdmv3lhn2ma7asjnsf5otr0bet(a)4ax.com... > Here is one method. This is not perfect but works based on your sample > data: > > SELECT catID, catName, > CASE WHEN CHARINDEX('"', catName) > 0 > THEN RIGHT('00' + LEFT(catName, CHARINDEX('"', catName)), > 3) > ELSE catName > END AS sort_size > FROM #tmpMyTable > ORDER BY sort_size; > > -- > Plamen Ratchev > http://www.SQLStudio.com
From: --CELKO-- on 26 May 2010 18:57
>> That will be a 72" item then? << .. which can be converted to feet-inch in the front end where display formatting is supposed to be done. Yet another reason we need to go Metric .. |