davedynamic
09-27-2001, 04:35 PM
In trying to make a query of sizes I have found a disconcerting flaw I do not know how to address.
My stock lines include sizes from 15 mm to 700 mm in 5 mm increments. When I sort these ascending and group by. I end up with 80mm being greater than 700 mm.
How do you sort strictly numerically?
shacket
09-27-2001, 05:18 PM
You need to have that information in a number field, not a text field. A text field sorts by the first character, meaning 700 comes before 80 (because 7 comes before 8). A numeric field looks at the actual number and would sort it appropriately.
R. Hicks
09-27-2001, 06:00 PM
Add a field expression to the query.
MySort: Val([YourSizeFieldName])
(change "YourSizeFieldName" to the actual name of your field that contains the size data)
Then set the sorting order by this field expression.
HTH
RDH
[This message has been edited by R. Hicks (edited 09-28-2001).]
Pat Hartman
09-28-2001, 02:06 PM
You might consider changing the table design so that you use two fields - Size and UnitOfMeasure. Storing multiple pieces of information in a single column is ALWAYS wrong.
Rick's suggestion to use the Val() function will work for you as long as the numeric portion of the mushed field is first.
R. Hicks
09-28-2001, 02:50 PM
I agree with Pat and I love that vivid description of the "mushed field".
RDH