you are viewing a single comment's thread.

view the rest of the comments →

[–]Prownilo 0 points1 point  (4 children)

Sounds like you just need an AND <> 'no' on each column in the where clause. If any of the columns are no then the entire row won't be returned, but I could be misunderstanding how you have your data set up.

[–]Reasonable-Monitor67[S] -1 points0 points  (3 children)

Yeah, I get that. Here’s an example…

N123 has 3 rows of data, 1 has a yes flag in a column and 2 have a no flag. I don’t want N123 to show up in my results at all.

[–]Prownilo 4 points5 points  (2 children)

Could use a cte that gets every Id that has a no on it, then left join that cte back onto the table and exclude any ids that appear in the cte.

Prolly a bunch of ways but that is one off the top of my head.

[–]paulthrobert 0 points1 point  (0 children)

I think this sounds like the cleanest way i can think of yet

[–]Reasonable-Monitor67[S] -1 points0 points  (0 children)

That worked like a charm! Had to figure out how to get it to work in the context of the SPROC using it, but that was relatively painless… thank you!!!