Sorting data in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble sorting by a certain field in my report. I have the
report sorted by 3 fields in the Sorting & Grouping box (ContractID,
ContractServices.Notes, and ServiceCode), but the ContractServices.Notes will
not sort. It used to sort fine, but when new contracts are added to the
report they don't sort like the others did. I'm using Access 2002.

SELECT tblCompanies.CompanyName, tblContractServices.ServiceCode,
tblContractServices.ServicePrice, tblContractServices.Notes,
tblContracts.Notes, tblServices.AlteerName, tblCompanies.CompanyID,
tblContracts.ContractID
FROM tblTypeofService INNER JOIN (tblServices INNER JOIN ((tblCompanies
INNER JOIN tblContracts ON tblCompanies.CompanyID = tblContracts.CompanyName)
INNER JOIN tblContractServices ON tblContracts.ContractID =
tblContractServices.ContractID) ON tblServices.ServiceID =
tblContractServices.ServiceCode) ON tblTypeofService.TypeofServiceID =
tblServices.TypeofService
WHERE (((tblContracts.Active)=Yes));
 
Are you actually attempting to sort on a field containing Notes? Is this a
memo field? If so, you can sort on the expression:

=Left(ContractServices.Notes,255)

BTW: I would alias the Notes fields like:
....tblContractServices.Notes as ContServNotes, tblContracts.Notes as
ContractNotes...
Then sort on
=Left(ContServNotes,255)
 
It worked...thank you!

Duane Hookom said:
Are you actually attempting to sort on a field containing Notes? Is this a
memo field? If so, you can sort on the expression:

=Left(ContractServices.Notes,255)

BTW: I would alias the Notes fields like:
....tblContractServices.Notes as ContServNotes, tblContracts.Notes as
ContractNotes...
Then sort on
=Left(ContServNotes,255)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Two Column Report 3
SQL Question 2
Crosstab Row Sorting in Alphabetical Order 7
Priority 2
Crosstab Report's subreport 1
Applying a Filter to a Sub Report 2
Repeating Data 4
Report by date range 6

Back
Top