We use this. Our revision starts at "-" then go to "A", "B", etc.. I assign an integer value to the revision and sort based on that.
SELECT
EPMDocumentMaster.CADName "CADName"
,EPMDocument.versionIdA2versionInfo "Revision"
,EPMDocument.iterationIdA2iterationInfo "Iteration"
,EPMDocument.statestate "State"
,PDMLinkProduct.namecontainerInfo "Product"
,SubFolder.name "Folder"
,CASE LEN(EPMDocument.versionIdA2versionInfo)
WHEN 1 THEN ASCII(EPMDocument.versionIdA2versionInfo) -64
WHEN 2 THEN ((ASCII(SUBSTRING(EPMDocument.versionIdA2versionInfo, 1, 1))-64)*26) + (ASCII(SUBSTRING(EPMDocument.versionIdA2versionInfo,2,1))-64)
END VersionLetterInt
FROM
EPMDocumentMaster
,EPMDocument
,PDMLinkProduct
,SubFolder
WHERE
EPMDocumentMaster.CADName = 'model_program_new.prt'
AND EPMDocument.idA3masterReference = EPMDocumentMaster.idA2A2
AND EPMDocument.idA3containerReference = PDMLinkProduct.idA2A2
AND EPMDocument.idA3B2folderingInfo = SubFolder.idA2A2
ORDER BY
VersionLetterInt ASC, Cast(EPMDocument.iterationIdA2iterationInfo AS INTEGER) ASC
Joe Kent
Engineering Systems Administrator
R&D/Leverage
Structural Brand Development / Mold Manufacturing
"With Us, Ideas Take Shape"