Can't sort in ascending order in query

chablups

Registered User.
Local time
Today, 22:11
Joined
Feb 2, 2002
Messages
88
I have made a query and one of the fields is a percentage. The percentage is a result of an expression (the division of a larger number into a smaller number). The problem is I can't get it to sort because, I think, there are too many decimals in the percentages, like each one is .980472497294792349274 or something like that, and when I go to sort, I get an error message that says "overflow." I have tried formating the percentage so that it is only one or decimals, but it still won't sort. This has been driving me crazy. There must be a simple answer -- yes?
 
NewField: CSng(Format(expression, "0.00"))
 
Thanks, but where do I write or put the code you gave me?

Sorry, I am new at this ... I don't know what to do with the code you suggest. Where do I put it? What do I do with it? Thanks.
 
You already said that one of your fields was an expression. Replace the word expression above with your expression and then copy the new expression that's made as your new field's calculation for sorting.
 
Did it, but still doesn't work ... help

Okay, I did exactly what you said, but it still didn't work. Here is what I put in the new field box:
CSng(Format([Your Total Listings 03]/[All Listings 03],"Fixed"))

Actually, I put exactly what you said but the "0.00" was apparently changed to the word "Fixed" by the Access program. And the "[Your Total Listings 03]/[All Listings 03]," replaced the word "expression" as you indicated I should do.

So anyway, it still doesn't limit the length of the number, and I still get the overflow message. Incidentally, I had previously tried formating using "fixed" under properties and it didn't work that way either. I have been trying to figure this one out for the last couple of days ... any other suggestions would be greatly appreciated. Thanks.
 

Users who are viewing this thread

Back
Top Bottom