Openings drilled in joists should not be inside 2 inches (51 mm) of the top or lower part of the joist. The distance across any opening will not surpass one-third area of the joist. The codes are 2308 & IRC R502.