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)
 
Back
Top