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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|