• et2brutuss (8/11/2014)


    I have written a relatively simple query but it generating zero results. I am not getting any error message, just no results. On the messages tab it says '0 rows affected'.

    Here is the query:

    use CLL_LIVE

    go

    SELECT Em.Empno

    ,RTRIM (em.GivenName)

    ,RTRIM (em.Surname)

    ,em.Position

    ,em.EMail

    ,p.Rate

    FROM Employee_Master AS em

    JOINPayDetail AS p

    onem.Empno = p.Empno

    WHERE em.EmployStatus <> 11

    It is pretty basic, Employee Id, Name, Position, Email and pay rate. As long as there is no join and the "rate" is not asked for it generates a list of all employees. Once I join the paydetail table, I get no results.

    Query the PayDetail table and verify that the Empno values in this table exists in the Employee_Master table.