February 13, 2013 at 1:42 am
[font="Courier New"]Hi All,
This is the query i have written but unable to extract last two char..
max(CASE CHARINDEX(' ', GT.FG_DESCRIPTION, 1) WHEN 0 THEN GT.FG_DESCRIPTION
ELSE SUBSTRING(GT.FG_DESCRIPTION, 1, CHARINDEX(' ', GT.FG_DESCRIPTION, 1) - 2) END) AS PROD_TYPE
Output coming
A B
14.00-24 32 PR BKT EM937 TL 14.00-2
700/40-22.5 16 PR BKT FLOT648 TL 700/40-22.
30.5L-32 12 PR BKT TR137 TR 30.5L-3
Required Output
A B
14.00-24 32 PR BKT EM937 TL TL
700/40-22.5 16 PR BKT FLOT648 TL TL
30.5L-32 12 PR BKT TR137 TR TR
Thanks
Bhushan[/font]
February 13, 2013 at 2:52 am
What does the original data look like? What is the DDL for the table?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply