Re: Multiplying query columns



As Doug stated, you haven't provided near enough information about what
you're doing for anyone to be of much help. Generally to get the sort of
statistic that you describe, you would need an aggregate query. Assuming
you have a table of students with some sort of unique ID, and a field called
gender, you would use something like this:

SELECT Gender, Count(StudentID) AS Students
FROM Student
Group BY Gender

This would return one line for each gender (hopefully just 2) with a count
for each.

HTH,
Randy


"Dave" <whovian223@xxxxxxxxxxx> wrote in message
news:pd97o19ms9c62fksbgrtgmtej43t69e79j@xxxxxxxxxx
> Hello
>
> I've created a student database for our program that I also need to
> get statistics from. It's in Access 2003.
>
> The statistics would be things like Male-Female percentage, percentage
> of students from various parts of the world, that sort of thing. I was
> going to start small by doing the gender statistics, but I've hit a
> bump.
>
> I have a query set up to give me all of the female students and a
> query for all the male students. Now, when I do a query to get the
> counts for both of these queries, it keeps on multiplying the two
> columns together (there are 213 Male and 225 Female, and both columns
> in the count query end up with "47925").
>
> I did a Google search on this group and found a number of responses to
> similar questions, all saying that the multiplication is because there
> is no relationships defined between the two queries and a "Cartesian
> Product" is being formulated instead. The problem is, I can't think
> of any way to relate these two queries that would result in the proper
> values being calculated. Relating the "Gender_Type ID" between the
> two gets me zero results (because each one is either Male or Female,
> so there is no common result) and it's pointless to relate the names
> in the queries either.
>
> I've been banging my head against this wall all afternoon, so any help
> would be appreciated.
>
> Thanks in advance.
>
> Dave

.



Relevant Pages

  • Multiplying query columns
    ... The statistics would be things like Male-Female percentage, ... of students from various parts of the world, ... query for all the male students. ... is no relationships defined between the two queries and a "Cartesian ...
    (comp.databases.ms-access)
  • Re: Multiplying query columns
    ... Sounds as though you need a UNION query, but without details about what your ... queries are returning, I can't offer any suggestion as to what that query ... > The statistics would be things like Male-Female percentage, ... > of students from various parts of the world, ...
    (comp.databases.ms-access)
  • RE: Using a subform to display and add info into table
    ... - Did you create a query by cutting & pasting the INSERT SQL statement into ... - With the Attendance form open, with a SessionID and SessionDate entered, ... >> Each instance will have many students, and, in fact, the same students that ... >> a combo box for the SessionID (with the same properties as the one on your ...
    (microsoft.public.access.forms)
  • RE: Access chart reports
    ... I would use the union query to create a chart on a form or report. ... FROM Students ... SELECT UniqueID, "AggressionPhysicalPresent" ...
    (microsoft.public.access.reports)
  • RE: Access chart reports
    ... I have finished the query now, thanks so much, except I still need to know ... FROM Students ... SELECT UniqueID, "AggressionPhysicalPresent" ... 57 AggressionPhysicalPresent behaviours. ...
    (microsoft.public.access.reports)