pullingteeth
Programmer
Let me tell you first what I'm trying to do, then what I've tried.
I have three tables (simplified) thus:
User
----
username:string
Records
-------
record_number:integer
status:integer
date:datetime
RecordErrors
------------
record_number:integer ---> Records.record_number
description:string
date:datetime
What I need to do is generate a report for all users showing their error percentage between two given dates. To compute this, I need to do the following calculation for each user:
x (number of records in x status by user between dates) / y (number of errors where the record was made by the user between dates) * 100
Since x and y are unrelated, I can't retrieve them in one query. Thus I thought of doing two queries, to get all the data for all users, and combining the queries programmatically - however I can't work out how to get a report to source its data from code. I'm using Access 97.
Thanks
I have three tables (simplified) thus:
User
----
username:string
Records
-------
record_number:integer
status:integer
date:datetime
RecordErrors
------------
record_number:integer ---> Records.record_number
description:string
date:datetime
What I need to do is generate a report for all users showing their error percentage between two given dates. To compute this, I need to do the following calculation for each user:
x (number of records in x status by user between dates) / y (number of errors where the record was made by the user between dates) * 100
Since x and y are unrelated, I can't retrieve them in one query. Thus I thought of doing two queries, to get all the data for all users, and combining the queries programmatically - however I can't work out how to get a report to source its data from code. I'm using Access 97.
Thanks