Join Problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tommyodn
    New Member
    • Oct 2008
    • 2

    Join Problems

    I have created a query with 2 tables, one is about student information and the other about there payments. I want to see payments for the students for a specific month - that I can do. But I don't know how to let the query show the student even if there is no record in the payments table. Pleas help
  • dulob
    New Member
    • Oct 2008
    • 1

    #2
    Code:
    SELECT Student.StudentName, iif([payment].payment is null, 0, [payment].payment) as Payment from student left join payment on student.studentid = payment.studentid

    Comment

    • DonRayner
      Recognized Expert Contributor
      • Sep 2008
      • 489

      #3
      Originally posted by tommyodn
      I have created a query with 2 tables, one is about student information and the other about there payments. I want to see payments for the students for a specific month - that I can do. But I don't know how to let the query show the student even if there is no record in the payments table. Pleas help
      In the query design window, double click on the join line between the two tables. You will then get a window with (left and right table name), (left and right column name) and three option buttons. Option 1 will be selected. You need to select the button that basicly says "include all records from student information table and only thoes records from payments table where the records are equal"

      Comment

      Working...