locked
Compare String Parameter with INTEGAR Column of DATASET RRS feed

  • Question

  • User843229376 posted

    I have one report which takes one STUDENTID (string) as input.

    I have one dataset which gets filled with values of TABLE ( all records of Table gets included).

    Now I want to filter the values of DATASET by comparing DATASET column with INPUT Parameter.

    For Eg :

    I have one Table STUDENT  which fills the DATASET1.

    STUDENT has three colunmns

    --STUDENTID

    --STUDENTNAME

    --ADDRESS

    Let  say I am passing Input Parameter @StudentId ='11,12,13'    ( This input parameter is concatenation of StudentIds 11,12,13)

    I need to check if these IDs in @StudentId are present in Table STUDENT and show data in DATASET1 which have these values and not any other..

    HOW to do this. I am not using STORED PROC....That is one handicap.

    I need to do all this in SSRS itself.

    Please help...Its urgent...!!!!

    Friday, July 29, 2011 9:03 AM

Answers

  • User1471008070 posted

    Hi,

    I think you can make use of T-SQL to return '11,12,13' like this '11','12','13', then you can create a dataset using T-SQL like this

    SELECT  * FROM dbo.table where StudentId in ('11','12','13'), then you will know whether DATASET1 which have these values and not any other

    If I misunderstand you, please feel free to let me know.

    Thanks,
    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 3, 2011 3:17 AM

All replies

  • User-1364446067 posted

    hi,

    Use IN operator. like:

    DataRow[] drSelectedRows = DataSet.Tables[0].Select("[StudentId] IN ('11','12','13')");

    --

    Hope this helps..

    Friday, July 29, 2011 9:07 AM
  • User1471008070 posted

    Hi,

    I think you can make use of T-SQL to return '11,12,13' like this '11','12','13', then you can create a dataset using T-SQL like this

    SELECT  * FROM dbo.table where StudentId in ('11','12','13'), then you will know whether DATASET1 which have these values and not any other

    If I misunderstand you, please feel free to let me know.

    Thanks,
    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 3, 2011 3:17 AM