Results 1 to 7 of 7
  1. #1
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    Query criteria

    Hi,

    I have a query that shows the classes that students are enrolled in. The results are displayed in a subform linked to the students ID#. The enrollment records (classes students are enrolled in) are identified by a four digit "ClassNumber" that is linked to a course name, section, instructor and year code. The year codes are 1129 for 2012-2013 and 1139 for 2013-2014. Students may have taken a course in a previous year (e.g 1129)and completed it. This is recorded as 100 (in a percent complete field).

    When I run the query all enrollment records are returned correctly but the ClassNumber field for the completed courses are vacant. The ClassNumbers for the "active" courses are showing.

    This is okay, except I would like some way of displaying the word "complete" or "2012-2013" or something in that empty field. Can this be done?




    Here is the SQL:

    SELECT StudentEnrollmentTable.StudentNumber, StudentEnrollmentTable.AnnualClassNumberID, AnnualClassNumbers1.FKCourseInventoryID, AnnualClassNumbers1.ClassNumber, AnnualClassNumbers1.TermNumber, CoursesNEW.[Course Title], SectionNEW.[Class Section], StudentEnrollmentTable.CourseStatus, StudentEnrollmentTable.StartDate, StudentEnrollmentTable.EndDate, StudentEnrollmentTable.Progress, StudentEnrollmentTable.GradeToDate, StudentEnrollmentTable.CourseCompletionDate, [LU_Instructor]![Initials] & " " & [LU_Instructor]![LastName] AS InstructorID
    FROM SectionNEW INNER JOIN (CoursesNEW INNER JOIN ((LU_Instructor INNER JOIN AnnualClassNumbers1 ON LU_Instructor.InstructorID = AnnualClassNumbers1.[FKInstructorID]) INNER JOIN StudentEnrollmentTable ON AnnualClassNumbers1.ID = StudentEnrollmentTable.AnnualClassNumberID) ON CoursesNEW.PKCourseID = AnnualClassNumbers1.FKCourseInventoryID) ON SectionNEW.PKSectionID = AnnualClassNumbers1.FKSectionID
    WHERE (((StudentEnrollmentTable.StudentNumber)=[Forms]![ALPc Student/Course Enrollment Form]![StudentNumber]) AND ((AnnualClassNumbers1.TermNumber)=1129)) OR (((AnnualClassNumbers1.TermNumber)=1139));

    Thanks and take care,

    Daryl

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Maybe:

    Nz(AnnualClassNumbers1.ClassNumber, "Completed") AS ClassNum
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Thanks June!

  4. #4
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    Hi June7,

    I am still working on a couple of things. The code above; Where does it go? Is it include in the SQL or in a criteria field on a query?


    TC,

    Daryl

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    It goes in the SELECT clause of query. It replaces the ClassNumber field.

    Alternatively, can use expression in textbox:

    =Nz([ClassNumber], "Completed")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167
    That for getting back to me on this one June7. I tried entering it in the SQL and it made no difference. (I did however start to see how SQL is organized). When you say "use expression in text box"... I am not sure... Currently the field is display in a ComboBox from which our Admin Assist can select ClassNumbers from when student enroll in a new course or change sections, etc. Do you suggest changing this to a text box or creating one on the form to diplay when a course is completed.

    Thanks and TC,

    Daryl

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    What do you mean it made no difference - the field still shows empty in the query? If you want to provide db for analysis, follow instructions at bottom of my post. Identify objects involved in issue.

    Not suggesting you change combobox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-02-2013, 11:07 AM
  2. Replies: 5
    Last Post: 05-01-2013, 11:39 AM
  3. Replies: 5
    Last Post: 09-20-2012, 03:27 PM
  4. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  5. Replies: 1
    Last Post: 07-13-2011, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums