I have a right join query (joining a table and another query output). I get “#Error” displayed in some rows. Is there a way to just display the rows which give “#Error” ?
Here is my query:
SELECT Table1.Number1, Table2.Number2
FROM Table2 RIGHT JOIN Table1 ON Table2.Number2 = Table1.Number1;
Sample Data:
Expr1 Expr2
2346 2346
2347 2347
2348 #Error
2349 2349
2350 2350
2351 2351
Sub Query:
SELECT Val(Right([String2],Len([String2])-8)) AS Number2
FROM Table3;
Thanks in advance
Just add a WHERE clause on the end. Should work fine. If you have multiple columns that the #ERROR rows might show up in, use a WHERE clause with ORs (or, alternately, ||s ) in it. If you toss out a clearer idea of which columns have #ERRORs in them, I could batch you together a code block for it, but it should be pretty easy for you to handle for yourself.
Edit: Correction:
You’re getting errors because you’re forcing table1 to show up even where there’s nothing in table 2 to match it. This will give you the orphans.