Hi Statalist

I'm analysing a household dataset. I'm interested in performing a command only if at least an individual within the household has a certain characteristic.
For example, let's auppose that I want to drop the household if there is at least a child (age<=18) in the household.
I was thinking to something like:

bysort idhd: if age<=18 drop idhh

But it (unsurprisingly) doen't work.
Thank you!