Hi,
I'm using Excel 2013 (Win 7) and am using MS Query to get data from our SQL Server - just using a single table. I want to display only the records where a value in one column is the same as that in the next column.
The data displayed is:
AccountNo
DebtorID
ParentDebtorID
The query is set up as:
SELECT DB_Main.AccountNo, DB_Main.DebtorID, DB_Main.ParentDebtorID
FROM DB1.DB_Main DB_Main
Where DB_Main.DebtorID = DB_Main.ParentDebtorID
For some reason, the results still include records where the DebtorID is not equal to the ParentDebtorID.
I have a work around in place which is to display all the records and then use a formula to indicate where the fields aren't the same so I can just sort and ignore those records, but it seems like it should be such an easy thing to do in the query. I'm sure I'm missing something obvious.
Can anyone see what I might be doing wrong? Let me know if more info is needed.
Thanks,
Scott
I'm using Excel 2013 (Win 7) and am using MS Query to get data from our SQL Server - just using a single table. I want to display only the records where a value in one column is the same as that in the next column.
The data displayed is:
AccountNo
DebtorID
ParentDebtorID
The query is set up as:
SELECT DB_Main.AccountNo, DB_Main.DebtorID, DB_Main.ParentDebtorID
FROM DB1.DB_Main DB_Main
Where DB_Main.DebtorID = DB_Main.ParentDebtorID
For some reason, the results still include records where the DebtorID is not equal to the ParentDebtorID.
I have a work around in place which is to display all the records and then use a formula to indicate where the fields aren't the same so I can just sort and ignore those records, but it seems like it should be such an easy thing to do in the query. I'm sure I'm missing something obvious.
Can anyone see what I might be doing wrong? Let me know if more info is needed.
Thanks,
Scott