• ssurekha2000 (9/27/2013)


    i have a SP with where condition

    as where id=@id and month=@month and Eid=@Eid

    wht i need is if @Eid=0 i need to display all the reocrds

    if Eid>0 then display only that particular reocrd

    i tried

    where id=@id and month=@month and Eid=

    case when @Eid=0 then Eid>0

    else

    Eid=@Eid

    End

    but its giving me error

    Incorrect syntax near '>'.

    You mean something like this?

    ...

    where

    id = @id and

    month = @month and

    ((@Eid = 0) or (Eid = @Eid))