Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    43

    Unanswered: Show ALL records, even if some field is NULL

    Hello, i am working now with C# program and MS Access database file.

    i am running this SQL query from C#:
    SELECT e_employees.EmployeeID, e_employees.FirstName, e_employees.LastName, e_employees.FathersName, e_employees.BirthDetails,
    e_employees.PassportDetails, e_employees.Address, e_employees.PhoneNumber, e_employees.CardExpireDate, e_employees.Details,
    d_divisions.DivisionName, t_titles.TitleName, c_countries.CountryName
    FROM (((e_employees INNER JOIN
    c_countries ON e_employees.CountryID = c_countries.CountryID) INNER JOIN
    d_divisions ON e_employees.DivisionID = d_divisions.DivisionID) INNER JOIN
    t_titles ON e_employees.TitleID = t_titles.TitleID)
    WHERE (e_employees.DivisionID = ?)


    problem is, that it doesnt show records, where i did not enter CountryID for employee... and of cuz CountryName is also empty...

    how to make this SQL query show ALL records (if any field is empty, then show NULL)
    ??

    thanks!

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    LEFT JOIN instead of INNER.
    George
    Home | Blog

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    This has some examples which might be worth looking at. It shows how to return records which have null values when using criteria such as Like....

    http://www.dbforums.com/showpost.php...6&postcount=39
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •