Query will not sort

L

Lenee

I have made a query and it will not sort one of my fields. I thought it was a
simple query but maybe not.

Field: Area, Sort Ascending
Field: OrderNumber, Sort Ascending
Field: Status, Criteria Like "*Y*"
Field: Week 1, Criteria Is Null

It will do everything except sort on the order number.
 
J

Jeff Boyce

Lenee

Please post the SQL statement of your query.

?Are you saying that the query should sort on OrderNumber first? If so, why
is Area first?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jeff Boyce

Lenee

Also, it would help to know what kind of data (e.g., examples) are in [Area]
and [OrderNumber]...

.... and what YOU mean by "not sort" ... what specifically is happening (or
not).

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John Spencer

One possible reason for this is if you have used a lookup combo to be able to
select order number from a combobox on the table involved. In that case, the
sort may be on what is actually stored in the field and NOT on what is
displayed when looking at the query in datasheet view.



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
L

Lenee

Jeff,

Here is the SQL statement. I had to make a new one but it is doing (or not
doing) the same thing.


-- SELECT CustomerT.CutArea, CustomerT.CutOrdNum, CustomerT.[2010 Status],
CustomerT.Cutwk1, CustomerT.Cutwk2
FROM CustomerT
WHERE (((CustomerT.[2010 Status]) Like "*Y*") AND ((CustomerT.Cutwk2) Is
Null))
ORDER BY CustomerT.CutArea, CustomerT.CutOrdNum;


What I need the query to do is sort
First on Area then on order Number.

What I mean by not sorting is, the query will not put the order number in
numerical order.

I am making route sheets for my employees and we have 17 different routes.
Then within each route there is an order number so the employee knows where
to go first and then down the list.

Area is a text field in the table and lookup. Data entered is: an, bf, bu,
cn. Again there are 17.

The order number is a number field: field size, Double, Format: General
Number.
Data entered is numbers 100 to 1000.

Not sure if I explained well, if not just ask. I am just really fustrated at
this time.

Lenee
 
J

Jerry Whittle

It should order by CutArea first then CutOrdNum next. If CutArea is a lookup,
that might be the problem as John mentioned.

It might help if you post and example of the data, maybe a little of the
CutArea and CutOrdNum fields so we can see what the problem looks like.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Lenee said:
Jeff,

Here is the SQL statement. I had to make a new one but it is doing (or not
doing) the same thing.


-- SELECT CustomerT.CutArea, CustomerT.CutOrdNum, CustomerT.[2010 Status],
CustomerT.Cutwk1, CustomerT.Cutwk2
FROM CustomerT
WHERE (((CustomerT.[2010 Status]) Like "*Y*") AND ((CustomerT.Cutwk2) Is
Null))
ORDER BY CustomerT.CutArea, CustomerT.CutOrdNum;


What I need the query to do is sort
First on Area then on order Number.

What I mean by not sorting is, the query will not put the order number in
numerical order.

I am making route sheets for my employees and we have 17 different routes.
Then within each route there is an order number so the employee knows where
to go first and then down the list.

Area is a text field in the table and lookup. Data entered is: an, bf, bu,
cn. Again there are 17.

The order number is a number field: field size, Double, Format: General
Number.
Data entered is numbers 100 to 1000.

Not sure if I explained well, if not just ask. I am just really fustrated at
this time.

Lenee


Lenee said:
I have made a query and it will not sort one of my fields. I thought it was a
simple query but maybe not.

Field: Area, Sort Ascending
Field: OrderNumber, Sort Ascending
Field: Status, Criteria Like "*Y*"
Field: Week 1, Criteria Is Null

It will do everything except sort on the order number.
 
F

Fred

If you are viewing the data in the query, you might have a sort in the view
that is overriding the query's sorts.

Try Records -> Remove Filter/Sort

Fred
 

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