AccessEd87
Registered User.
- Local time
- Today, 09:24
- Joined
- Oct 7, 2015
- Messages
- 12
Dear community,
If you could help me out with writing a very specific query I would be immensely grateful.
Problem:
My database has a client table with basic information (name, DOB, home town, current place of work, occupation etc.)
I need to run a query that will return the percentage of clients with a particular occupation (lets say, nurse, for example purposes). Here's the tricky bit. I need this broken down by month, with a random sample of 50 clients per month, and then collated by annual quarter.
The final output would ideally look like this:
Month Total Sample Size 'Nurses" within sample % Nurses
Jan 50 35 70%
Feb 50 47 94%
March 50 40 80%
I've got part of the way there. To get the random sample, I have used the Rnd() function in the query, sorting ascending by this function and then limiting the number of returns to 50. By using a parameter query for date ranges, I can then run the query 3 times, once for each month to get the overall data for the quarter.
I think I then need to tie this into a totals query to finish the job, but can't quite work out how to get it into 1 query output at the end. In an ideal world, I'm looking for something thats as close to a 1 click solution as possible.
Many thanks for your help in advance!
Ed
If you could help me out with writing a very specific query I would be immensely grateful.
Problem:
My database has a client table with basic information (name, DOB, home town, current place of work, occupation etc.)
I need to run a query that will return the percentage of clients with a particular occupation (lets say, nurse, for example purposes). Here's the tricky bit. I need this broken down by month, with a random sample of 50 clients per month, and then collated by annual quarter.
The final output would ideally look like this:
Month Total Sample Size 'Nurses" within sample % Nurses
Jan 50 35 70%
Feb 50 47 94%
March 50 40 80%
I've got part of the way there. To get the random sample, I have used the Rnd() function in the query, sorting ascending by this function and then limiting the number of returns to 50. By using a parameter query for date ranges, I can then run the query 3 times, once for each month to get the overall data for the quarter.
I think I then need to tie this into a totals query to finish the job, but can't quite work out how to get it into 1 query output at the end. In an ideal world, I'm looking for something thats as close to a 1 click solution as possible.
Many thanks for your help in advance!
Ed