FredP Posted July 22, 2006 Share Posted July 22, 2006 Not sure, why, but I am trying to count the number of records that a project has. If i have a table called Jobs and inside that a field names Task. Job Could be set to Job10 Tasks would be a unique number or name. I want to count how many tasks Job10 has. I tried to just use a calculation an a global that was somehing like FinalCount = count( Jobs::Task ) But that returns nothing. I did a search, and found alot of references to how to find out how to count the number of related records, but none of them got it to work. Anyone? Link to comment Share on other sites More sharing options...
Maarten Witberg Posted July 22, 2006 Share Posted July 22, 2006 The calculation looks OK. Use the TaskID field as count() counts nonempty fields not records. The relationship should be jobID to jobID. hope this helps kjoe Link to comment Share on other sites More sharing options...
LaRetta Posted July 22, 2006 Share Posted July 22, 2006 A few things here ... 1) "I tried to just use a calculation an a global". You cannot use a global calculation. You must use an unstored calc because you will reference a related table (your selfJoin) and global calculations (by their nature) are stored and won't update based upon another table or upon other records within same table. 2) "Jobs and inside that a field names Task." You need a self-join relationship joining JobID = JobID and then count non-empty task field. 3) "FinalCount = count( Jobs::Task )." I'm unsure whether you are referencing your original table or the selfJoin. To clarify, you need to count the RELATED tasks field as: Count ( selfJoin::Tasks ) LaRetta smiley-laughing Link to comment Share on other sites More sharing options...
Recommended Posts