Pls help URGENT!!!

  •  

    How do i select all the processes from my dropdown?In my dropdown i have three options All,Forclosure,Bancrupcy.How do i select All so that it should display both forclosure and bancrupcy processes.Below is the query i am uing.

     

     

    declare @Attorneyrname as string

    declare @Report_Parameter_1 as string

    SELECT DISTINCT

    dbo.tblVENDOR.VendorName, dbo.tblVENDOR.VendorShortName, dbo.tblRAIL.RailDescr, dbo.tblSPIKE.SpikeDescr, dbo.tblRAIL.ScreenValue,

    dbo.tlkpSID.SId, dbo.tblConVendtoSuperClient.VendorID

    FROM dbo.tlkpSID INNER JOIN

    dbo.tblSPIKE ON dbo.tlkpSID.SidID = dbo.tblSPIKE.SidId INNER JOIN

    dbo.tblRAIL INNER JOIN

    dbo.tblVENDOR ON dbo.tblRAIL.SuperClientVendorId = dbo.tblVENDOR.VendorId ON dbo.tblSPIKE.RailId = dbo.tblRAIL.RailId INNER JOIN

    dbo.tblConVendtoSuperClient ON dbo.tblVENDOR.VendorId = dbo.tblConVendtoSuperClient.SuperClientId

    WHERE (dbo.tblConVendtoSuperClient.VendorID = 199) AND (dbo.tblvendor.vendorid <> 123)

    and (dbo.tblVENDOR.VendorName = @Attorneyrname) and

    dbo.tblRAIL.lkpRailid = CASE @Report_Parameter_1

           WHEN 'Forclosure' THEN 1

           WHEN 'Bankrupcy' THEN 2

          END

  • declare @Attorneyrname as string

    declare @Report_Parameter_1 as string

    declare @params table (ID tinyint)

    if @Report_Parameter_1 = 'All'

    Begin

       insert into @params (ID)

       select 1 union

       select 2

    End

    else

    insert into @params (ID)

    select CASE @Report_Parameter_1

           WHEN 'Forclosure' THEN 1

           WHEN 'Bankrupcy' THEN 2

          END

    SELECT DISTINCT

    dbo.tblVENDOR.VendorName, dbo.tblVENDOR.VendorShortName, dbo.tblRAIL.RailDescr, dbo.tblSPIKE.SpikeDescr, dbo.tblRAIL.ScreenValue,

    dbo.tlkpSID.SId, dbo.tblConVendtoSuperClient.VendorID

    FROM dbo.tlkpSID INNER JOIN

    dbo.tblSPIKE ON dbo.tlkpSID.SidID = dbo.tblSPIKE.SidId INNER JOIN

    dbo.tblRAIL INNER JOIN

    dbo.tblVENDOR ON dbo.tblRAIL.SuperClientVendorId = dbo.tblVENDOR.VendorId ON dbo.tblSPIKE.RailId = dbo.tblRAIL.RailId INNER JOIN

    dbo.tblConVendtoSuperClient ON dbo.tblVENDOR.VendorId = dbo.tblConVendtoSuperClient.SuperClientId

    WHERE (dbo.tblConVendtoSuperClient.VendorID = 199) AND (dbo.tblvendor.vendorid <> 123)

    and (dbo.tblVENDOR.VendorName = @Attorneyrname) and

    dbo.tblRAIL.lkpRailid in (select ID from @params)

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

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