Negative first

Crilen007

Uhm, Title... *shrug*
Local time
Today, 15:10
Joined
Jun 13, 2003
Messages
531
Hey, I tried searching for this, also tried the help files.

Guess I'm not sure what to ask...

On reports or queries or anything really, I always get negatives first, how can I stop this?

Instead of

0
-2
-5
500
200
100


id rather have

500
200
100
0
-2
-5
 
Sort on the amount field in descending order.
 
Yea, thats what I did, and it puts negative first.
 
Perhaps some other field is higher in the sort priority? Or the field is text rather than a number, which will return unexpected results. If not, can you post a sample?
 
0
-2
-5
500
200
100

Basically, this sort order can't happen without something else doing the driving behind the scenes.

As a signed long or integer descending, you should see 500, 200, 100, 0, -2, and -5 last, in that order. As signed long ascending, -5 should lead off, not 0. Also, in the latter case, 100 should preceed 500. Currency, Single, and Double would be approximately the same as LONG with respect to sort order since none of the numbers are fractional.

As UNsigned long or integer, you should see 0, 100, 200, ... -5, -2 ascending or -2, -5, ... 0 descending. Though how you get Access to do an unsigned integer sort, I'm not sure.

As text, you should see the numbers in order as -2, -5, 0, 100, 200, 500 if the field is left-justified or if the sign is left-justified and the rest of the field is right-justified; or 0, -2, -5, 100, 200, 500 if the entire field is right-justified with leading blanks before the minus signs and NO blanks between the signs and the first digit of the signed numbers.

You cannot represent these numbers in Yes/No format and retain them, and you cannot sort on a Memo field. The other possible field types would not represent the numbers you gave in your example. That leaves me with no way to get there from here.

Therefore, if you see the numbers in that order, you aren't sorting on the field that contains them. Or if you are, they are being driven by some other field you have not shown us, and that field is earlier in the sort order.

Is there a chance that the field is not sorted at all? And further, that there is no primary key on that table, or that the primary key is not the field you have shown us?
 
Only one field in the sort.
The number has been summed from other numbers, so its a number.

Its formatted as currency in the Query and the Report.
 
If the numbers are the results of a Summation query, you had set that up with a group-by clause. The numbers (your sums) are appearing in the order of the group-by element even if it wasn't called out in the final query that gave you those numbers, because a summation query implies a sort in order to implement the group-by clause.
 
Fixed it.

Changed the group from "Each value" to "Interval" that fixed it.
 

Users who are viewing this thread

Back
Top Bottom