Hello:
I would like to get some recommendations with setting up a crosstab query. I believe a have a data set that just "screams CROSSTAB" but I'm not entirely certain how to set it up given the large number of Boolean fields.
Background:
- Attached DB contains a table with 30 sample records.
- Table [tblExampleData] contains 18 fields where [ID] contains distinct autonumber AND [SECTION_NUM] includes 10 records = "1" and 20 records = "2".
- The remaining 16 fields are all Yes/No fields...
- ... where values across fields [DATA_TYPE_DATE], [DATA_TYPE_INT], [DATA_TYPE_REAL], [DATA_TYPE_VARCHAR] can only exist in one or the other of these 4 fields
- ... alternatively, for the remaining 12 fields ([NULL], [B], [C], [D], ..., ..., [F]), there can be any number of records = TRUE. **
** Please note the one-letter fields names, e.g., [B], [C], [D], etc. are abbreviations for longer fieldname strings. That's just how the customer shortened them.
Additional Information:
- I currently have a query "qry01_Count_for_B_With_SectionNumber" which only includes field [B] and its associated count of {10, 2, 18} for [SECTION_NUM] = {1, 2} & TRUE/FALSE.
- I think it would be perfectly fine to remove field [SECTION_NUM] from that query. Thus, "qry02_Count_for_B_Without_SectionNumber", I get values {2, 28} based on field [B] = TRUE/FALSE, respectively.
- The 2nd query (without [ID]) appears to be the preferred method... i.e., I don't think I need to separate my records by section number in the crosstab... unless it is very easy do to (i.e., include/exclude it).
- Well, [ID] maybe required for the CROSSTAB... not entirely certain here.
My question:
- How can I create a crosstab query that creates a matrix of the 16 Boolean fields?
Final Comments:
- Again, maybe somehow it is field [ID] by/over ([DATA_TYPE_INT], [DATA_TYPE_REAL], [DATA_TYPE_VARCHAR]).
- A 2nd query would be field [ID] by/over ([NULL], [B], [C], [D], ..., ..., [F]).
- However, if these two can be merged, that'll be fine too.
I'd welcome any recommendations how to best display/output this very simplified data set in a meaningful crosstab query.
Thank you,
EEH