0

I have two tables that I need to get the following information but I can't seem to figure out how to structure the query:

Table 1

type
show
max
min

Table 2
model
height
width
depth

In Table 1 I have the following for the first row (as an example):

height
18" - 21.9"
21.9
18

and

Model
19.9
25.9
30.1

Basically in Table I want to link the two tables and have it count out the number of results for each parameter. For example, on the navbar I want it to grab each row and show the following by counting the number of models and then showing it next to each row. Then I want to use the result Further down in table 1 are rows with width parameters, depth parameters, etc.

Height:
18" - 21.9" (number of models)

Does that make sense?

I've tried:

mysql_query("SELECT 
    count(Dimensions.model) AS total, dimensions_table.show, dimensions_table.max as maxd, dimensions_table.min as mind, dimension_table.type as ptype
FROM 
    Dimensions, dimensions_table
    WHERE Dimensions.ptype BETWEEN dimensions_table.maxd AND dimensions_table.mind");

But so far it's not returning any results?

Edited by patsfans: fixed code

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Icone
0

Test your problem in the access query design and do your inputs there to see what's going wrong. Do forget to do some inputs.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.