• Hi, how about :-

    SELECT

    *

    from

    account A

    inner Join Contact C on a.primarykey=c.accountkey

    inner join Address D on A.primarykey=D.foreignkey

    WHERE

    case

    when @Aname is null then A.Name

    else @Aname

    end = A.Name

    and

    case

    when @Cfirst is null then C.firstName

    else @Cfirst

    end = C.firstName

    and

    case

    when @Clast is null then C.lastName

    else @Clast

    end = C.lastName

    and

    case

    when @city is null then D.city

    else @city

    end = D.city

    and

    case

    when @state is null then D.state

    else @state

    end = D.state

    and

    case

    when @phone is null then D.phone

    else @phone

    end = D.phone

    Andy

    andyj93@hotmail.com

    .