Hi!
The Oerlikon 20mm cannon (used on naval vessels) had an effective range of about 1000 yards. This weapon is in the same class (barrel length, muzzle velocity, and fire control) as the 20mm AA used on U-boats, so 1000 yards looks right for those systems. AA using 37mm cannons would have a somewhat greater effective range.
As a reference, check out the After Action Report of
USS Enterprise for the Battle of the Santa Cruz Islands (October 1942)
here, where the commander asks for an increase in the 1000 yard effective range of 20mm cannon to better help deal with dive bomber attacks.
Pablo