How to Open a Closed estimate?

The scrips below are used to set a Closed Version back to Open. These scripts are to be run by a DBA/ IT Department against the DESTINIData database

/******Find the name of the Estimate and version******/
select ev.[key], ev.ClosedDate, ev.notes, est.EstimateName, ev.VersionName
from Estimates est
JOIN EstimateContainers ec on ec.EstimateKey = est.[key]
JOIN EstimateVersions ev on ev.[key] = ec.VersionKey
where est.EstimateName like '%ESTIMATENAME%'

4. This script set the estimate back to Open. 

/******Set an estimate to Open that was closed using the VERSIONKEY******/
Update EstimateVersions
set ClosedDate = '0001-01-01 00:00:00.0000000' , Notes = ''
where [key] = N'7B36EA3B-AFF6-EA11-9678-000D3A8FB743'

Note: If the estimate is in the Template folder, then Open the estimate > Estimate Properties, Uncheck the IsTemplate box, and save the estimate if you want it as an Estimate and not a Template. 

If you want to set an Open Estimate to close, you run the same command and set the ClosedDate. 

Example below: 

/******Set an estimate to Open that was closed using the VERSIONKEY******/
Update EstimateVersions
set ClosedDate = '2022-12-18 16:00:00.0000000' , Notes = 'CLOSED'
where [key] = N'7B36EA3B-AFF6-EA11-9678-000D3A8FB743'