O
OppThumb
Hi,
I'm trying to use the ORDER BY option in both my Table design and in a
separate SQL query, and I'm getting the same puzzling result either
way. The two fields in the query below are text fields, nothing
special (Unicode compression is set to "Yes", but I don't see how that
could make a difference):
SELECT [Element name], [value]
FROM [analysis table]
WHERE [Element name] = "TEST-ELEMENT"
ORDER BY Trim([Value]);
Here's are the before-and-after results for my query. The "before"
represents the way it was loaded into the table, and when I open the
table, that's the way I see it:
Without ORDER BY:
Element name value
TEST-ELEMENT -00013700.00 THRU 00008669.06
TEST-ELEMENT 00008669.07 THRU 00031038.13
TEST-ELEMENT 00031038.14 THRU 00053407.20
TEST-ELEMENT 00053407.21 THRU 00075776.27
TEST-ELEMENT 00075776.28 THRU 00098145.34
TEST-ELEMENT 00098145.35 THRU 00120514.41
TEST-ELEMENT 00120514.42 THRU 00142883.48
TEST-ELEMENT 00142883.49 THRU 00165252.55
TEST-ELEMENT 00187621.63 THRU 00209990.70
With ORDER BY:
Element name Value
TEST-ELEMENT 00008669.07 THRU 00031038.13
TEST-ELEMENT -00013700.00 THRU 00008669.06
TEST-ELEMENT 00031038.14 THRU 00053407.20
TEST-ELEMENT 00053407.21 THRU 00075776.27
TEST-ELEMENT 00075776.28 THRU 00098145.34
TEST-ELEMENT 00098145.35 THRU 00120514.41
TEST-ELEMENT 00120514.42 THRU 00142883.48
TEST-ELEMENT 00142883.49 THRU 00165252.55
TEST-ELEMENT 00187621.63 THRU 00209990.70
Soooooo, why -- when I put the ORDER BY in my query -- does the
negative value appear in row #2? Can anybody suggest a way to put it
back in the right order? Based on this example it might appear that
the obvious thing is to take out the ORDER BY, but I can't always
count on them being in ascending order.
Any help will be appreciated.
Thanks,
John
I'm trying to use the ORDER BY option in both my Table design and in a
separate SQL query, and I'm getting the same puzzling result either
way. The two fields in the query below are text fields, nothing
special (Unicode compression is set to "Yes", but I don't see how that
could make a difference):
SELECT [Element name], [value]
FROM [analysis table]
WHERE [Element name] = "TEST-ELEMENT"
ORDER BY Trim([Value]);
Here's are the before-and-after results for my query. The "before"
represents the way it was loaded into the table, and when I open the
table, that's the way I see it:
Without ORDER BY:
Element name value
TEST-ELEMENT -00013700.00 THRU 00008669.06
TEST-ELEMENT 00008669.07 THRU 00031038.13
TEST-ELEMENT 00031038.14 THRU 00053407.20
TEST-ELEMENT 00053407.21 THRU 00075776.27
TEST-ELEMENT 00075776.28 THRU 00098145.34
TEST-ELEMENT 00098145.35 THRU 00120514.41
TEST-ELEMENT 00120514.42 THRU 00142883.48
TEST-ELEMENT 00142883.49 THRU 00165252.55
TEST-ELEMENT 00187621.63 THRU 00209990.70
With ORDER BY:
Element name Value
TEST-ELEMENT 00008669.07 THRU 00031038.13
TEST-ELEMENT -00013700.00 THRU 00008669.06
TEST-ELEMENT 00031038.14 THRU 00053407.20
TEST-ELEMENT 00053407.21 THRU 00075776.27
TEST-ELEMENT 00075776.28 THRU 00098145.34
TEST-ELEMENT 00098145.35 THRU 00120514.41
TEST-ELEMENT 00120514.42 THRU 00142883.48
TEST-ELEMENT 00142883.49 THRU 00165252.55
TEST-ELEMENT 00187621.63 THRU 00209990.70
Soooooo, why -- when I put the ORDER BY in my query -- does the
negative value appear in row #2? Can anybody suggest a way to put it
back in the right order? Based on this example it might appear that
the obvious thing is to take out the ORDER BY, but I can't always
count on them being in ascending order.
Any help will be appreciated.
Thanks,
John