Filtrar recordsed con SQL

Latorre

New Member
Joined
Jan 20, 2009
Messages
19
Hola amigos, les presento mi duda, tengo una tabla de referencias cruzadas de access y quiero traerla a excel filtrada. entonces al momento de importarla usando ADO DAO, tengo un comando para filtrar, pero este es solamente por columnas, y yo lo que necesito es la informacion que tiene cada columna ejemplo.

tengo

mes chile brasil españa
1 10 10 30
2 20 15 50
3 30 16 70
4 40 17 90

y lo que necesito es obtener

mes chile
1 10
2 20
3 30
4 40


tengo este codigo pero me filtra segun columnas.

Code:
strSQL = "SELECT * FROM " & strTabla & " WHERE [filtro] = 'quefiltrar' "
recSet.Open strSQL, datConnection

saludos, y se agradece cualquier ayuda
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Al menos que no estoy comprendiendo bien, creo que simplemente sería
Code:
strSQL = "SELECT MES, CHILE FROM " & strTabla & " WHERE [filtro] = 'quefiltrar' "
 
Upvote 0

Forum statistics

Threads
1,223,968
Messages
6,175,677
Members
452,666
Latest member
AllexDee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top