Forum Moderators: open

Message Too Old, No Replies

Access Database Query Problem

         

daddywhite

2:33 pm on Jun 24, 2003 (gmt 0)

10+ Year Member



I have a database with fields such as:

MM1034 ¦ MM1035 ¦ MM1036 ETC

and these contain True/False data.

I need to create a crosstab query giving totals (of trues) for each field. I would like to set it out like this:

Title StartDate
Sept 2002 Sept 2003
MM1034
MM1035 TOTALS DISPLAYED HERE
MM1036

Howevere I cannot get it to do it. I beleive this to be bacause uin the table the MMetc;s are FIELD NAMES and not FIELD VALUES. Is there anyway to extract the field names from a table and display them in a query dynaset?

Please Help

mivox

12:08 am on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



*bump*
Thought you might have better luck with your question here in our Microsoft technology forum... :)

deejay

1:52 am on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




This may actually be more of an issue with your table structure.

I assume your table currently also has a field for 'date', as that is a required output.

In that sort of event, I would tend to structure the table as:

primary key ¦ date ¦ product id ¦ yes/no

Product ID would contain your 'mm' data.

At first glance it looks like bloat, because you may be entering more records, but the yes/no field may or may not then be required as presumably you would only enter record at a 'yes' (or vice versa), and this is likely to save a lot of space. It also gives you much greater flexiblity in analysis. Hard to tell without some more structural/functional information.

In any case, you can access the field names as query data with your present setup, but it's getting into a bit of code, so I have stickied you a discussion from another forum which explains the method.