SELECT non NULL records, then sort them
Having trouble sorting records (using ADO with Excel VBA on Access DB file). The field I'm interested in can have numeric or NULL values. I only want the records with non-NULL values for field XX and then sort them. Using the following select statement, I get the records I want, but they aren't sorted. How to fix?
Code:
SELECT * FROM TestTable WHERE NOT ISNULL(XX) ORDER BY XX
Re: SELECT non NULL records, then sort them
SELECT * FROM TestTable WHERE XX IS NOT NULL ORDER BY XX
Re: SELECT non NULL records, then sort them
Quote:
Originally Posted by
Smartacus
SELECT * FROM TestTable WHERE XX IS NOT NULL ORDER BY XX
I tried that also. Same result. The sorting by XX doesn't make sense. Here is example of the result (showing XX only)
Code:
100.
100.
2.
48.
90.
95.
99.
99.
The thought just occurred to me that maybe the values are being interpreted as text. Need to check that...
Re: SELECT non NULL records, then sort them
Is XX a string field or a numeric field? I don't mean that the VALUE is numeric... but the actual DATA TYPE of the field itself?
-tg