Is it possible to sort on more than 3 fields?

J

Jane Schuster

Business, Last Name, First Name, and Contact Date? I'm using Access 2003.
 
J

Jeff Boyce

*(yes, probably)*

Where?

Where are you trying to sort? In a report? Look at the <Sorting &
Grouping> button.



Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

Business, Last Name, First Name, and Contact Date? I'm using Access 2003.

In a report?
In report design view, click on View + Sorting and Grouping.
In the upper panel in the Field/Expression column enter
[Business]
[LastName]
[FirstName]
[Contact Date]
 
J

Jane Schuster

Yes, in a report. I tried it using the Sorting and Grouping button, but the
report does not sort the ContactDate (the 4th sort level) correctly. I've
also tried in the Source Record SQL to group by these four fields, but
according to the answers posted here that makes no difference in the report's
output. According to the book I'm using (QUE Using Access, for Access 97),
you can group, up to a maximum of 3 levels. I need to get to 4. I'm
thinking someone else has probably had that need and has figured out a
workaround. Also, I wonder why there are more than 3 levels that can be
idenified when you open the Sorting and Grouping button if you can only do a
maximum of 3, (but that's for another day).
 
J

Jane Schuster

Yes, in a report. I did add the Contact Date as the 4th sort, but the report
is not sorting correctly on that field.

fredg said:
Business, Last Name, First Name, and Contact Date? I'm using Access 2003.

In a report?
In report design view, click on View + Sorting and Grouping.
In the upper panel in the Field/Expression column enter
[Business]
[LastName]
[FirstName]
[Contact Date]
 
F

fredg

Yes, in a report. I did add the Contact Date as the 4th sort, but the report
is not sorting correctly on that field.

fredg said:
Business, Last Name, First Name, and Contact Date? I'm using Access 2003.

In a report?
In report design view, click on View + Sorting and Grouping.
In the upper panel in the Field/Expression column enter
[Business]
[LastName]
[FirstName]
[Contact Date]
What does "Not sorting correctly" tell us about your report?
You're not helping yourself by being cryptic with your messages.
I would suspect that perhaps [Contact Date] is not a datetime
datatype, (probably Text), but you have given us no example of how the
report is being sorted and how you would like it to be sorted. It's
kind of like "Doctor I don't feel well" without giving any more
information. Give us an example of what you get and what you want.
 
J

Jane Schuster

Sorry. I didn't mean to be cryptic. Let's say, I have the following:

Business: ABC Machines
LastName: Smith
FirstName: Bob
ContactDate: 01/01/2008
ContactDate:02/01/2008
ContactDate: 03/01/2008
Business: BCD Machines
LastNate: Smith
FirstName: Bob
ContactDate: 01/01/2008
ContactDate: 02/01/2008
ContactDate: 03/01/2008

That's how I want the report to print (well, I want it to print in
descending order by ContactDate, but it isn't doing that either, although
that's what I specified on the Sorting and Grouping Screen). I've got the
first sort on Business, the second on LastName, the third on FirstName, and
the fourth on ContactDate.


Fredgwrote:
Yes, in a report. I did add the Contact Date as the 4th sort, but the report
is not sorting correctly on that field.

fredg said:
On Thu, 4 Sep 2008 15:48:01 -0700, Jane Schuster wrote:

Business, Last Name, First Name, and Contact Date? I'm using Access 2003.

In a report?
In report design view, click on View + Sorting and Grouping.
In the upper panel in the Field/Expression column enter
[Business]
[LastName]
[FirstName]
[Contact Date]
What does "Not sorting correctly" tell us about your report?
You're not helping yourself by being cryptic with your messages.
I would suspect that perhaps [Contact Date] is not a datetime
datatype, (probably Text), but you have given us no example of how the
report is being sorted and how you would like it to be sorted. It's
kind of like "Doctor I don't feel well" without giving any more
information. Give us an example of what you get and what you want.
 
R

Rick Brandt

Jane said:
Sorry. I didn't mean to be cryptic. Let's say, I have the following:

Business: ABC Machines
LastName: Smith
FirstName: Bob
ContactDate: 01/01/2008
ContactDate:02/01/2008
ContactDate: 03/01/2008
Business: BCD Machines
LastNate: Smith
FirstName: Bob
ContactDate: 01/01/2008
ContactDate: 02/01/2008
ContactDate: 03/01/2008

That's how I want the report to print (well, I want it to print in
descending order by ContactDate, but it isn't doing that either,
although that's what I specified on the Sorting and Grouping Screen).
I've got the first sort on Business, the second on LastName, the
third on FirstName, and the fourth on ContactDate.

You haven't indicated the sort that you ARE getting. Almost certainly your
dates are being sorted as text because you have an expression that is
converting them from dates to strings.

If the data in a field looks like a date there are really only two possible
ways for the sort to be applied, chronological, or alphabetical. If you are
getting the latter then you have to find out where your dates are being
changed into strings. Use of the Format() function is the most common
reason.
 
J

Jane Schuster

The ContactDate is a Date/Time field, what I'm getting appears to be random,
sometimes it's right, other times it's not. There doesn't appear to be any
logic in the way it is sorting.
 
J

Jeff Boyce

Jane

You aren't perceiving any pattern ... but we still don't have an example of
how it is sorting, so we can't offer our ideas about what might be
happening.


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

Rick Brandt

Jane said:
The ContactDate is a Date/Time field,

The point that we might not be making clearly enough is that the fact that
is starts out at its source table as a DateTime field does not mean that it
is still a DateTime value by the time it gets to your report for sorting.

There are any number of things in between that might be changing it into a
string and thus your report will sort it as a string.
what I'm getting appears to be
random, sometimes it's right, other times it's not. There doesn't
appear to be any logic in the way it is sorting.

Please show an exact example of the incorrect sorting you are seeing.
 

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