Or you could just create a simple crosstab report.

--- On Tue, 1/27/09, Dennis Jensen <[email protected]> wrote:

From: Dennis Jensen <[email protected]>
Subject: Re: [Access VBA Central] Varying the number of columns in a query
To: [email protected]
Date: Tuesday, January 27, 2009, 1:23 PM






Create a Query that gives you the multiple column information and then build a 
second query that simply pulls the data you want from the first query.

--- On Tue, 1/27/09, renato ab <renato...@yahoo. com.br> wrote:

From: renato ab <renato...@yahoo. com.br>
Subject: [Access VBA Central] Varying the number of columns in a query
To: AccessVBACentral@ yahoogroups. com
Date: Tuesday, January 27, 2009, 7:17 AM

Hi all,
I would like to build a query that shows as many columns as I need. I'm looking 
for it and didn't find any answer.
Could anyone help me?

The problem is the following

I have the Main table:

id month value type
1 jan 30 1
2 jan 10 2
3 jan 15 2
4 fev 20 1
5 fev 15 3
6 fev 10 1
7 fev 40 3
8 mar 15 2
9 mar 10 1
10 mar 20 3

And the table Types:

id name 
1 lunch
2 bus
3 shopping

And I want my query to show the sum of each type in each month, like this:

month lunch bus shopping
jan 30 25 0
fev 30 0 40
mar 10 15 20

But the query has to show as many columns as the table Types have.
That is, if I add columns to the table types I don't want to modify the query.

Could anyone help me?

Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbusca dos.yahoo. com

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

 














      

[Non-text portions of this message have been removed]

Reply via email to