A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sorting Numbers



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2009, 07:35 PM posted to microsoft.public.access.reports
denise
external usenet poster
 
Posts: 388
Default Sorting Numbers

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.
  #2  
Old August 12th, 2009, 09:45 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Sorting Numbers

If you have numbers in a text field and you want to sort them as if the field
were numeric, you will need to change the Sorting and Grouping expression
from the field name to something like:

=Val([Field Name])

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.

  #3  
Old August 13th, 2009, 12:55 PM posted to microsoft.public.access.reports
denise
external usenet poster
 
Posts: 388
Default Sorting Numbers

Duane,

Where do I put that expression in the table?

Where do I put that expression in the query?

Where do I put that expression in the form?

Where do I put that expression in the report?

Yes it is a text field because I have 20a, 20b, 20c and 20d, etc.

Thanks.

Denise



--
Denise B.


"Duane Hookom" wrote:

If you have numbers in a text field and you want to sort them as if the field
were numeric, you will need to change the Sorting and Grouping expression
from the field name to something like:

=Val([Field Name])

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.

  #4  
Old August 13th, 2009, 01:34 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Sorting Numbers

You seem to have forgotten to mention there are letters as well as numbers.
This solution should work either way as long as the numbers are always first.

" change the Sorting and Grouping expression " this is in the report design.
The only reliable method for sorting a report is to use this dialog.

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

Duane,

Where do I put that expression in the table?

Where do I put that expression in the query?

Where do I put that expression in the form?

Where do I put that expression in the report?

Yes it is a text field because I have 20a, 20b, 20c and 20d, etc.

Thanks.

Denise



--
Denise B.


"Duane Hookom" wrote:

If you have numbers in a text field and you want to sort them as if the field
were numeric, you will need to change the Sorting and Grouping expression
from the field name to something like:

=Val([Field Name])

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.

  #5  
Old August 13th, 2009, 01:52 PM posted to microsoft.public.access.reports
denise
external usenet poster
 
Posts: 388
Default Sorting Numbers

Duane,

I also use a query to lookup the questions in a combo box? How do I get the
numbers to fall in order here?

Thanks.

Denise
--
Denise B.


"Duane Hookom" wrote:

You seem to have forgotten to mention there are letters as well as numbers.
This solution should work either way as long as the numbers are always first.

" change the Sorting and Grouping expression " this is in the report design.
The only reliable method for sorting a report is to use this dialog.

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

Duane,

Where do I put that expression in the table?

Where do I put that expression in the query?

Where do I put that expression in the form?

Where do I put that expression in the report?

Yes it is a text field because I have 20a, 20b, 20c and 20d, etc.

Thanks.

Denise



--
Denise B.


"Duane Hookom" wrote:

If you have numbers in a text field and you want to sort them as if the field
were numeric, you will need to change the Sorting and Grouping expression
from the field name to something like:

=Val([Field Name])

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.

  #6  
Old August 13th, 2009, 02:08 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Sorting Numbers

You would use the same Val() function in the Row Source of your combo box.

SELECT YourField
FROM YourTable
ORDER BY Val(YourField);

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

Duane,

I also use a query to lookup the questions in a combo box? How do I get the
numbers to fall in order here?

Thanks.

Denise
--
Denise B.


"Duane Hookom" wrote:

You seem to have forgotten to mention there are letters as well as numbers.
This solution should work either way as long as the numbers are always first.

" change the Sorting and Grouping expression " this is in the report design.
The only reliable method for sorting a report is to use this dialog.

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

Duane,

Where do I put that expression in the table?

Where do I put that expression in the query?

Where do I put that expression in the form?

Where do I put that expression in the report?

Yes it is a text field because I have 20a, 20b, 20c and 20d, etc.

Thanks.

Denise



--
Denise B.


"Duane Hookom" wrote:

If you have numbers in a text field and you want to sort them as if the field
were numeric, you will need to change the Sorting and Grouping expression
from the field name to something like:

=Val([Field Name])

--
Duane Hookom
Microsoft Access MVP


"Denise" wrote:

I have a table that has questions number 1 to 150.

When you sort A to Z it puts the numbers like,

1, 11, 100, etc.

How do you get the numbers to sort in numerical order. I have added and
deleted some questions so the new records go to the end.

thanks.
--
Denise B.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.