Sorting data in a report

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));
 
D

Duane Hookom

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)
 
G

Guest

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

Top