'In google sheets what's the syntax to pull from another sheet, a line item that contains #N/A in a column?

In google sheets what's the syntax to pull from another sheet, a line item that contains #N/A in a column? I am writing the script on tab1 and the data I am pulling from is on tab2 and tab3. tab2 and tab3 contains vlookups that have a few #N/A's. I am trying to aggregate all the line items where there is an #N/A in col9 onto tab1

the below is what I have in tab1 but I dont think its correct

=QUERY(({tab1!A2:L;tab2!A2:L}),"SELECT\* where Col9 is '#N/A'")


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source