I have a database which among other things records how jobs are received – i.e.: Telephone, Email, Mail, Facsimile or Web.
For each client I want to identify the percentages of each method of receipt against the total of jobs received and during different time periods.
I have created a make table query for all jobs received between variable dates for a client – entry of the name of the client and the start and finish dates are required to run the query.
I have a crosstab query set up to count each method of receipt and a final query to work out the percentages – using the total from the crosstab query fields divided by the total of all methods.
I have a macro set up to replace the table with new data when I want the stats for a different client between new dates, therefore the different ‘methods of receipt’ may vary for the less active clients i.e.: they may only have telephone and email .
My problem is if I choose a client where we have not received a job by a particular method (say web or facsimile), the last query working out the percentages has fixed names to cover each method but naturally produces an error when it cannot find a corresponding method of receipt. I have experimented with NZ() without success.
My question is can I either have preset standard names of the column field in a crosstab query? Alternatively in the query calculating the percentages, can I include code to ignore a non-existent field in the crosstab query.
I may be doing this the long way but would appreciate any help please.
For each client I want to identify the percentages of each method of receipt against the total of jobs received and during different time periods.
I have created a make table query for all jobs received between variable dates for a client – entry of the name of the client and the start and finish dates are required to run the query.
I have a crosstab query set up to count each method of receipt and a final query to work out the percentages – using the total from the crosstab query fields divided by the total of all methods.
I have a macro set up to replace the table with new data when I want the stats for a different client between new dates, therefore the different ‘methods of receipt’ may vary for the less active clients i.e.: they may only have telephone and email .
My problem is if I choose a client where we have not received a job by a particular method (say web or facsimile), the last query working out the percentages has fixed names to cover each method but naturally produces an error when it cannot find a corresponding method of receipt. I have experimented with NZ() without success.
My question is can I either have preset standard names of the column field in a crosstab query? Alternatively in the query calculating the percentages, can I include code to ignore a non-existent field in the crosstab query.
I may be doing this the long way but would appreciate any help please.