![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have got a routine to store statistics of document status on a weekly basis to identify trends. *There are several status points of documents, for example, Not Written, Draft, Preview, In Work, Complete, Under Evaluation, Completed. These are also spread across 4 departments. *I use a straightforward select query to detemine status, then a crosstab based on that query to count the number of documents at a certain status within each department. *The routine then checks to see if an update already has been made that week, if so deletes the week concerned and updates via an append query based on the crosstab, and if not already saved (i.e. first occurence) just runs *the append query. The problem arises where for a given week, there are no documents in a particular category, i.e. draft, in which case the fields are not created in the append query and there is an error generated. I relaise that a more longwinded way of doing this is through Dcount, andNz but that would be a lot more complicated and not very elegant. *Is there any way to make a crosstab work around base fields and have the contents as zero if they are? Thanks Bz -- --------------------------------- --- -- - Posted with NewsLeecher v4.0 Final Web @http://www.newsleecher.com/?usenet ------------------- ----- ---- -- - |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I have got a routine to store statistics of document status on a weekly basis to identify trends. There are several status points of documents, for example, Not Written, Draft, Preview, In Work, Complete, Under Evaluation, Completed. These are also spread across 4 departments. I use a straightforward select query to detemine status, then a crosstab based on that query to count the number of documents at a certain status within each department. The routine then checks to see if an update already has been made that week, if so deletes the week concerned and updates via an append query based on the crosstab, and if not already saved (i.e. first occurence) just runs the append query. The problem arises where for a given week, there are no documents in a particular category, i.e. draft, in which case the fields are not created in the append query and there is an error generated. I relaise that a more longwinded way of doing this is through Dcount, and Nz but that would be a lot more complicated and not very elegant. Is there any way to make a crosstab work around base fields and have the contents as zero if they are? Thanks Bz |
#5
| |||
| |||
|
|
The column headings won't work as the cross tab reads the status and department and then counts number of each category against each department. If there are zero to count then it doesn't read the category? Bz -- --------------------------------- --- -- - Posted with NewsLeecher v4.0 Final Web @http://www.newsleecher.com/?usenet ------------------- ----- ---- -- - |
#6
| |||
| |||
|
|
The column headings won't work as the cross tab reads the status and department and then counts number of each category against each department. If there are zero to count then it doesn't read the category? Bz |
![]() |
| Thread Tools | |
| Display Modes | |
| |