Sorting with select distict

MarionD

Registered User.
Local time
Today, 13:28
Joined
Oct 10, 2000
Messages
425
I'm back again - and need help AGAIN...

I want to select Patient Number from a query where the the number appears more than once. (the query is patient nr. inner joined to treatments) I want to print a report, so the number but be selected with distinct... but I would like the oprint run to be sorted by surname, Firstname

Set Tempdaten = db.OpenRecordset("Select distinct [patnr] from qry_tempdaten")

but if I try to add an order by it of course won't do it because I've selected only the Patnr.......
I only need the patient number in the recordset, but sorted.

Is this possble?
 
There's no reason you can't select a bunch of fields (including those you want to sort by) and just not display them. Just don't add your sort fields to the report's displayed fields.
 

Users who are viewing this thread

Back
Top Bottom