I have a colum calld [SUBID] that is a compund of two numbers Sub.Par in the format "000000.000000".
so to extract the last sub number wrote the following select statement:
Select top 1 case when len (cast(isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7)))< 2 then '0'+ cast( isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7)) else cast( isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7))end +'.00' from dbo.Proposals order by SUBID DESC
it works fine to numbers up to 99.00, it will not find the 100.00, why? any help will be much apreciated.
thanks,
AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
so to extract the last sub number wrote the following select statement:
Select top 1 case when len (cast(isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7)))< 2 then '0'+ cast( isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7)) else cast( isnull(substring ([SubID], 1, CHARINDEX ( '.' , [SubID], 1)-1), '00')+1 as varchar(7))end +'.00' from dbo.Proposals order by SUBID DESC
it works fine to numbers up to 99.00, it will not find the 100.00, why? any help will be much apreciated.
thanks,
AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"