3 Replies Latest reply on Jun 10, 2014 6:04 AM by philmodjunk

    Calculation field in Event table to count Distinct Students attending

    gregdc

      Title

      Calculation field in Event table to count Distinct Students attending

      Post

           I am back with yet another question for Pro Advance 13.   This time I have a table of Events with a 1toM relationship with Students (each event has many students)

           I have a calculation field in the Event table to count the number of distinct students assigned to that Event.   

           StudentCount (Auto-enter Calculation replaces existing value, Evaluate Always) I started with is:

           GetAsNumber ( 
           Let ( 
           [ExecuteSQL ("SELECT COUNT (DISTINCT TrainingParticipant::Person_Id) FROM TrainingParticipant WHERE TrainingParticipant::Training_Id = ?"  ; "" ; "";Training_Event_Id)
           ))
            
           But I tried the one in the snapshot.  Same result.
            
           The field never calculates the count.   It does not show "?" in the table, just blanks.
           Someone care to shove me in the right direction on this.  I have looked through the K-base but nothing works.
            
           Thanks yet again, I really appreciate the helpfulness of this forum's people!

      StudentCount.PNG