entering multiple Id''s in a parameter

  • Hi,

    I am recreating a report in RS2000 that is currently sitting in Crystal. There is an id parameter that allows you to enter more than one id i.e (0124,5468 etc)

    The report runs from a store procedure, so I don't think I need to change anything there. I think it may have something to do with how you enter the id's when trying to do the same thing in RS2000.

    Could someone please point me in the right direction as to what I need to do.

    Thanks

    Tracy

     

     

  • Actually it the multiple parametres in Sql Server 2005.Instead try to create some procedure like this in Database

    CREATE FUNCTION dbo.Split

    (

    @ItemList NVARCHAR(4000),

    @delimiter CHAR(1)

    )

    RETURNS @IDTable TABLE (Item VARCHAR(50))

    AS

    BEGIN

    DECLARE @tempItemList NVARCHAR(4000)

    SET @tempItemList = @ItemList

    DECLARE @i INT

    DECLARE @Item NVARCHAR(4000)

    SET @tempItemList = REPLACE (@tempItemList, ' ', '')

    SET @i = CHARINDEX(@delimiter, @tempItemList)

    WHILE (LEN(@tempItemList) > 0)

    BEGIN

    IF @i = 0

    SET @Item = @tempItemList

    ELSE

    SET @Item = LEFT(@tempItemList, @i - 1)

    INSERT INTO @IDTable(Item) VALUES(@Item)

    IF @i = 0

    SET @tempItemList = ''

    ELSE

    SET @tempItemList = RIGHT(@tempItemList, LEN(@tempItemList) - @i)

    SET @i = CHARINDEX(@delimiter, @tempItemList)

    END

    RETURN

    END

    GO

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

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