Extracting Values

  • I have created a table..fileds like

    fld_category fld_amount

    a+b+c 10+10+10

    fld_category and fld_amount ,values is inserted from .net application. Now i need to extract values from fld_amount like '10' at a time..substring command might not work coz the values may vary. I need query in sql I am creating report using oledb.. Its very urgent please help

  • What about the separator between the values...?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • How about this code...

    Declare @a varchar(10)

    Set @a = '100+101+12'

    while @a <> ''

    begin

    if charIndex('+',@a) > 0

    begin

    Select SubString(@a,0,charIndex('+',@a))

    Set @a = SubString(@a,charIndex('+',@a)+1,Len(@a))

    end

    else

    begin

    Select @a

    Set @a = ''

    end

    end

    use Your Field name against @a variable

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • so how to write query to extract the values ??

  • thanks a lot it really did help

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply