Hey all,
I'm having quite a bizarre time trying to add two columns together in a query - can anyone offer any advice?
For the sake of simplicity, my query looks like:
- [Course Enrolments].[Student Number] (Group by)
- [Course Enrolments].[Enrolment ID] (Count)
- Passes: NZ([Number of passes per learner].[Passes],0) (Group by)
- Fails: NZ([Number of fails per learner].[Fails],0) (Group by)
- Results Pending: NZ([Pending results per learner].[pending],0) (Group by)
Then I had added a column which reads:
- Total: [Passes]+[Fails]
Now, here's where it all gets odd!
Let's say a student has 3 passes and 1 fail. You would expect the result in Total to be 4, right? Well - I'm getting 31! If a student gets 2 passes and 2 fails, the result is 22 rather than 4. The formula seems to be compounding the results rather than adding them.
Does anyone have any suggestions for getting around this?
The reason I need the total column is that I want to add in another column that reads... Pass rate: ([Passes]\[Total])*100 (perhaps I'm being too ambitious here, but I'm sure Access must have the power to do it!)
Thanks
Steve
I'm having quite a bizarre time trying to add two columns together in a query - can anyone offer any advice?
For the sake of simplicity, my query looks like:
- [Course Enrolments].[Student Number] (Group by)
- [Course Enrolments].[Enrolment ID] (Count)
- Passes: NZ([Number of passes per learner].[Passes],0) (Group by)
- Fails: NZ([Number of fails per learner].[Fails],0) (Group by)
- Results Pending: NZ([Pending results per learner].[pending],0) (Group by)
Then I had added a column which reads:
- Total: [Passes]+[Fails]
Now, here's where it all gets odd!
Let's say a student has 3 passes and 1 fail. You would expect the result in Total to be 4, right? Well - I'm getting 31! If a student gets 2 passes and 2 fails, the result is 22 rather than 4. The formula seems to be compounding the results rather than adding them.
Does anyone have any suggestions for getting around this?
The reason I need the total column is that I want to add in another column that reads... Pass rate: ([Passes]\[Total])*100 (perhaps I'm being too ambitious here, but I'm sure Access must have the power to do it!)
Thanks
Steve