first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

PROBLEM: a Column with "Numbers" And Text Is Not Sorting Correctly

Suppose you have a function bound to a field in a query or form. This function performs calculations and then returns the number as a string. This will be the case when you want to use the Format() function in the bound function or return custom text messages as well as numerical values.

The subsequent column of data based on the bound function will now be sorted as String data. To make sure that numbers sort properly, format numerical output with leading zeros. This is not too unattractive with percentages. For example, when MyValue = 0.05,

Format(MyValue, "000.000%") = "005.000%"

makes only two leading zeros. However to make numbers larger than Integer sort properly, this method is not recommended.

mod date: 1998-06-19T18:32:12.000Z