> WHERE AgeOfChild <= 12 and AgeOfChild = value
You're again making the bad move of having two possibly contradicting conditions on the same field.
One number can be <=12 and at the same time can be 11, but then it's the same condition as simply querying AgeOfChild = 11. And if value>12 you have no record, thus all records are not in that empty set.
You're losing the condition you wanted. You need a workshop on logic, as it seems.
You're most probably not even aware that this condition is about what no child of a parent should be, this subquery is processed with [tt]NOT in[/tt], which means you get records of the main select that are NOT in that sub query.
You have to understand, that this condition is programmed as negation of your condition ALL children should be older than 12, negated to the condition, that NO child is younger. If you add conditions here, you add conditions to the children a person should NOT have.
I strongly assume your real query again is more complex and you don't combine conditions corectly. And most probably this time brackets are not helping.
> how to make the id_no available for searching or making it index..
There are several ids for each name, so that's not available.
Please, as you are really not that good in putting conditions into code, tell us in english, what people and names you want, and we might give you this "fish" (instead of teaching you fishing).
Bye, Olaf.