Appeal from an amended judgment of the Supreme Court (Kane, J.), entered July 2, 2001 in Sullivan County, which, in a proceeding pursuant to CPLR article 78, inter alia, denied petitioner’s motion to hold respondent in contempt.
On June 1, 1998, the Zoning Board of Appeals of the Town of Tusten granted petitioner a 46-foot variance from the applicable setback requirement of the Town of Tusten Zoning Ordinance for the construction of a structure on his property. On March 28, 2000, petitioner filed an application for a building permit with respondent Stephen Stuart, the Town’s Code Enforcement Officer. Stuart issued a written determination denying the application upon four stated grounds: (1) pursuant to section 710.7 (F) (5) of the Zoning Ordinance, the variance expired 90 days following its issuance based on petitioner’s failure to act upon it, (2) the building plans provided insufficient data to determine compliance with light and ventilation requirements of the State Uniform Fire Protection and Building Code, (3) petitioner’s property is located in a special flood hazard area and no letter of map amendment was filed ensuring that the basement was at least one foot above the base flood elevation, and (4) petitioner failed to submit proof of work*678ers’ compensation insurance and disability insurance coverage by the contractor/builder. Petitioner thereafter sought administrative review of Stuart’s determination. Addressing only the first of the grounds for denial of the building permit application, the Zoning Board of Appeals upheld Stuart’s interpretation of the Zoning Ordinance.
Petitioner then brought this CPLR article 78 proceeding to review respondents’ determinations. Although the petition addressed only respondents’ interpretation of the “sunset” provision of the Zoning Ordinance, it sought judgment, inter alia, directing respondents to issue petitioner a building permit “in accordance with his * * * application.” Respondents’ answer contested only petitioner’s interpretation of the Zoning Ordinance and made no reference, by means of affirmative defense or otherwise, to the fact that the expiration of the variance was but one of four grounds for denial of the building permit application and that, even if petitioner were to prevail on the interpretation issue, he would not be entitled to the issuance of a building permit. Agreeing with petitioner on the interpretation issue and obviously unaware of any other impediments to the issuance of a building permit, Supreme Court granted the petition “in its entirety” and judgment was entered accordingly.
After the expiration of respondents’ time to appeal, petitioner served respondents with a “demand for compliance” and, based upon their continuing refusal to issue a building permit, moved to hold respondents in contempt. In its consideration of the contempt application, Supreme Court became aware of the additional grounds for denial of the building permit application. Supreme Court denied petitioner’s contempt motion and, sua sponte, vacated so much of its decision and judgment as reversed respondents’ determinations and directed respondents to issue petitioner a building permit. Petitioner appeals.
In our view, there is merit to petitioner’s contention that, under the facts presented here, Supreme Court lacked jurisdiction to vacate, sua sponte, its own judgment. Although there can be no doubt of a trial court’s discretion to cure mistakes, defects and irregularities that do not affect substantial rights of parties (see, CPLR 5019 [a]; Kiker v Nassau County, 85 NY2d 879, 881) or to amend a judgment “to make it reflect what the court’s holding * * * clearly intended” (Siegel, Practice Commentaries, McKinney’s Cons Laws of NY, Book 7B, CPLR 5019, at 671; see, Di Prospero v Ford Motor Co., 105 AD2d 479, 480), it is equally well settled that a “trial court has no revisory or appellate jurisdiction to correct by amendment [an] error in *679substance affecting the judgment” (Herpe v Herpe, 225 NY 323, 327; Osamwonyi v Grigorian, 220 AD2d 400, 401; Baum v Baum, 40 AD2d 1000, 1001; First Natl. City Bank v Elsky, 62 Misc 2d 880, 881). Considering that Supreme Court’s amendment had the effect of taking back the affirmative relief previously granted to petitioner, we cannot classify its initial “error” as anything other than a matter of substance. Furthermore, although Supreme Court’s original judgment was undoubtedly based on a misapprehension of the underlying facts and circumstances, this is not a case of a conflict between the court’s written decision and the judgment entered thereon (cf., Di Prospero v Ford Motor Co., supra at 480; Stormville Mtn. Homes v Zurhorst, 35 AD2d 562). Here, the decision and judgment were embodied in the same writing and both were, of course, based on the same erroneous assumption as to the underlying facts.
Nor is it by any means “ridiculous,” as respondents would characterize it, to lay the ultimate blame on them. To the extent that petitioner’s prayer for relief was not supported by the factual allegations of the petition, it was incumbent upon respondents to disclose that defect in their answer or by means of a motion addressed to the petition. Surely, respondents could have attacked the petition for failure to state a cause of action based on the conflict between its factual allegations and prayer for relief or based on petitioner’s failure to address or to exhaust available administrative remedies with regard to the second, third and fourth grounds for denial of the building permit application. In addition, following the entry of Supreme Court’s “erroneous” judgment, respondents could have appealed it, but instead did nothing.
Cardona, P.J., Peters, Carpinello and Rose, JJ., concur. Ordered that the amended judgment is modified, on the law, without costs, by reversing so much thereof as vacated the October 31, 2000 judgment; judgment reinstated and matter remitted to the Supreme Court for further proceedings not inconsistent with this Court’s decision; and, as so modified, affirmed.