The bringing of an action or proceeding in the wrong county shall not be deemed a jurisdictional defect, but the court may of its own motion and must on the motion of a party defendant transfer the action or proceeding to a proper county. The motion by the defendant for such relief must be made in writing and on notice and must be filed with the clerk before or at joinder of issue. It must specify the county to which the defendant desires the action or proceeding to be transferred and must state under oath facts showing that ground exists for such transfer. In the absence of timely motion by the defendant, he shall be deemed to have waived any objection relating to proper venue, except in the case of a real property action.
The transfer of a real property action from an improper to the proper county may be had at any time by motion or otherwise.
N.Y. New York City Civil Court Law § 306