ACCESS grouping by sql

0

Hi, I have a query with the following sql:

SELECT Tabla1.Campo1, [CTrefercruz].Expr2, [CTrefercruz].[Total de Campo8], [CTrefercruz2].[Total de Campo8], [CTrefercruz3].[Total de Campo8]
FROM ([CTrefercruz3] RIGHT JOIN [CTrefercruz2] ON [CTrefercruz3].Expr2 = [CTrefercruz2].Expr2) RIGHT JOIN ([CTrefercruz] LEFT JOIN Tabla1 ON [CTrefercruz].Expr2 = Tabla1.Campo1) ON [CTrefercruz2].Expr2 = [CTrefercruz].Expr2

GROUP BY Tabla1.Campo1, [CTrefercruz].Expr2, [CTrefercruz].[Total de Campo8], [CTrefercruz2].[Total de Campo8], [CTrefercruz3].[Total de Campo8]

I'm getting 4 cross-reference queries with the same field that shows a grouping by percentages. My problem is that field1 has a prefixed percentage which is where I would like to group, whereas expr2 is the percentages that appear:

  

Field1 0.00% // // 0.20% // 0.35% // // 0.50% // 0.75% //   1%

     

Expr2 0 // 0.15 // 0.2 // // 0.38 // 0.50 // 0.75 //   1

As you can see, it links the fields to me according to them, my problem is that I would like those that do not appear in Field1, such as 0.15 or 0.38, to group me the totals in the immediately superior one, that is, in this case in the 20% and 50% respectively.

Thanks in advance.

    
asked by Adri_A 13.06.2018 в 11:14
source

0 answers