sorting by version number

  • Thread starter Thread starter Devon
  • Start date Start date
D

Devon

I have two tables of data that I am using in a report.
Relationships are set up correctly, and everything seems
to be working fine, but I have a question concerning
sorting the records.

Main Table: DID, DocumentName, DocumentOwner
Version Table: VID, DocumentVersion, DateUpdated, DID

Above is a very simplistic version of the fields on the
table. What I am attempting to do is combine the two
tables on one report. I then am sorting the report in
descending order off of the Document Version, but only
want to show the most current version.

For example, if I have a document named ABC.doc, and have
versions 1, 2, 3, 4, 5, etc..., I only want to show the
most current version of that document, followed by the
most current version of the next document, etc.

Can this be accomplished in Access? If so, could someone
please assist me?

Thanks in advance
 
Hi Devon.
You would create a main report based on a unique query by DID and grouped by
DID.
Now create a subreport based on a query with the DID, Document Version and
Date Updated. In the criteria for the DID enter
[Reports]![MainReport]![DID]. Set the Top Values property for this query to
1.
Place this subreport in the detail band of the main report.
Relate the reports by DID.
This should do the job.
Hope this helps.
Fons
 
Back
Top