Good morning,
I have a database for registering drawings for a construction company. The drawings are registered according to date received and revision letter/number. The query for the register report uses the MaxOf date and Last Rev letter and produces a summary report.
This database has been in use for approx. 3 years without a problem until this week when one of the architects issued revision B and C of the same drawing on the same day. The report is therefore showing both revisions when I need it to only show the last revision - Rev C.
I've included the SQL of the query. Hoping someone can help me with this.
Thanks in advance for your help
I have a database for registering drawings for a construction company. The drawings are registered according to date received and revision letter/number. The query for the register report uses the MaxOf date and Last Rev letter and produces a summary report.
This database has been in use for approx. 3 years without a problem until this week when one of the architects issued revision B and C of the same drawing on the same day. The report is therefore showing both revisions when I need it to only show the last revision - Rev C.
I've included the SQL of the query. Hoping someone can help me with this.
Thanks in advance for your help
Code:
SELECT QRYContractsReg.ContractNo,
TBLDwgRegister.ContractName, TBLDwgRegister.IssuedBy,
QRYSmryDwgReg.DrawingNo, QRYSmryDwgReg.DwgNo,
QRYSmryDwgReg.DrawingTitle, QRYSmryDwgReg.MaxOfDateIssued,
TBLDwgRegisterDtls.Rev, TBLDwgRegisterDtls.RevNotes,
TBLDwgTypes.DrawingID
FROM TBLDwgTypes INNER JOIN (QRYContractsReg INNER JOIN
((TBLDwgRegister INNER JOIN QRYSmryDwgReg ON
(TBLDwgRegister.DrawingNo = QRYSmryDwgReg.DrawingNo) AND
(TBLDwgRegister.DrawingTitle = QRYSmryDwgReg.DrawingTitle)) INNER
JOIN TBLDwgRegisterDtls ON (TBLDwgRegister.DrawingNo =
TBLDwgRegisterDtls.DrawingNo) AND (QRYSmryDwgReg.MaxOfDateIssued =
TBLDwgRegisterDtls.DateIssued)) ON QRYContractsReg.ContractName =
TBLDwgRegister.ContractName) ON TBLDwgTypes.DrawingID =
TBLDwgRegisterDtls.DwgType
WHERE (((TBLDwgRegister.Discontinued)=False))
ORDER BY QRYContractsReg.ContractNo, TBLDwgRegister.ContractName,
TBLDwgRegister.IssuedBy, QRYSmryDwgReg.DrawingNo,
QRYSmryDwgReg.DrawingNo, TBLDwgRegisterDtls.Rev DESC;
Last edited by a moderator: