ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Advanced Query not returning correct results?! (https://www.excelbanter.com/excel-discussion-misc-queries/239113-advanced-query-not-returning-correct-results.html)

Webtechie

Advanced Query not returning correct results?!
 
Hello,

I have a table

EmployeeID Assignmentment
1 6
1 7
2 5


The criteria range is

EmployeeID Assignment
2

The CopyTo Range keeps showing

EmployeeID Assignmentment
1 6
1 7
2 5


Why?!! It should show:

EmployeeID Assignmentment
2 5




Jim Thomlinson

Advanced Query not returning correct results?!
 
Perhaps I am missing something but what are you talking about??? Are you
using formulas or are you doing an external query. Is your query parameter
driven. If it is an external query post your SQL. If it is a formula post
your formula.
--
HTH...

Jim Thomlinson


"Webtechie" wrote:

Hello,

I have a table

EmployeeID Assignmentment
1 6
1 7
2 5


The criteria range is

EmployeeID Assignment
2

The CopyTo Range keeps showing

EmployeeID Assignmentment
1 6
1 7
2 5


Why?!! It should show:

EmployeeID Assignmentment
2 5




Webtechie

Advanced Query not returning correct results?!
 
You could be missing something or I was not clear enough:

1) I have a worksheet
2) I am using the Advanced Filter to copy values from my table to a
"copyto" range.
3) The table is located in Columns a b
4) This is supposed to be a basic spreadsheet query (using the advanaced
filter).

Hopefully that clarifes it for you.

Tony



"Jim Thomlinson" wrote:

Perhaps I am missing something but what are you talking about??? Are you
using formulas or are you doing an external query. Is your query parameter
driven. If it is an external query post your SQL. If it is a formula post
your formula.
--
HTH...

Jim Thomlinson


"Webtechie" wrote:

Hello,

I have a table

EmployeeID Assignmentment
1 6
1 7
2 5


The criteria range is

EmployeeID Assignment
2

The CopyTo Range keeps showing

EmployeeID Assignmentment
1 6
1 7
2 5


Why?!! It should show:

EmployeeID Assignmentment
2 5




Jim Thomlinson

Advanced Query not returning correct results?!
 
That is an advanced filter and not a query... In any case... it works for me.
My best guess would be your criterai range is not set correctly. Make sure
that the column header is included as part of the cirteria range. Otherwise
the filter will not know which column the filter applies to.

Here is what I have. Your original table in Cells A1:B4. The criteria is in
cells D1:D2 and looks like

Employee ID
2

My Copy to Range is F1:G1

--
HTH...

Jim Thomlinson


"Webtechie" wrote:

You could be missing something or I was not clear enough:

1) I have a worksheet
2) I am using the Advanced Filter to copy values from my table to a
"copyto" range.
3) The table is located in Columns a b
4) This is supposed to be a basic spreadsheet query (using the advanaced
filter).

Hopefully that clarifes it for you.

Tony



"Jim Thomlinson" wrote:

Perhaps I am missing something but what are you talking about??? Are you
using formulas or are you doing an external query. Is your query parameter
driven. If it is an external query post your SQL. If it is a formula post
your formula.
--
HTH...

Jim Thomlinson


"Webtechie" wrote:

Hello,

I have a table

EmployeeID Assignmentment
1 6
1 7
2 5


The criteria range is

EmployeeID Assignment
2

The CopyTo Range keeps showing

EmployeeID Assignmentment
1 6
1 7
2 5


Why?!! It should show:

EmployeeID Assignmentment
2 5




Webtechie

Advanced Query not returning correct results?!
 
The headers were fine.

I noticed that the criteria range included an extra line. Instead of
DA1:DA2, it was DA1:DA3. This blank row, of course, was causing everything
in the table to be returned. I made the criteria range DA1:DA2 and it is
working fine.

Tony

"Jim Thomlinson" wrote:

That is an advanced filter and not a query... In any case... it works for me.
My best guess would be your criterai range is not set correctly. Make sure
that the column header is included as part of the cirteria range. Otherwise
the filter will not know which column the filter applies to.

Here is what I have. Your original table in Cells A1:B4. The criteria is in
cells D1:D2 and looks like

Employee ID
2

My Copy to Range is F1:G1

--
HTH...

Jim Thomlinson


"Webtechie" wrote:

You could be missing something or I was not clear enough:

1) I have a worksheet
2) I am using the Advanced Filter to copy values from my table to a
"copyto" range.
3) The table is located in Columns a b
4) This is supposed to be a basic spreadsheet query (using the advanaced
filter).

Hopefully that clarifes it for you.

Tony



"Jim Thomlinson" wrote:

Perhaps I am missing something but what are you talking about??? Are you
using formulas or are you doing an external query. Is your query parameter
driven. If it is an external query post your SQL. If it is a formula post
your formula.
--
HTH...

Jim Thomlinson


"Webtechie" wrote:

Hello,

I have a table

EmployeeID Assignmentment
1 6
1 7
2 5


The criteria range is

EmployeeID Assignment
2

The CopyTo Range keeps showing

EmployeeID Assignmentment
1 6
1 7
2 5


Why?!! It should show:

EmployeeID Assignmentment
2 5





All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com