aaronward
Board Regular
- Joined
- Aug 2, 2006
- Messages
- 165
I have a a table with primary key being [Account Number]. I am trying to order all my accounts by their priority and then return the next account to be worked (the top account). i use the sql like:
However, upon using the order by clause, ALL account numbers are returned. Likewise, i can take out the order by clause it works, but i am unable to work my first priorty, then 2nd priorty, etc. Any ideas?
Code:
SELECT TOP 1 [Account Number]
FROM LiveData
WHERE WorkingRep Is Null
ORDER BY Priority ASC;
However, upon using the order by clause, ALL account numbers are returned. Likewise, i can take out the order by clause it works, but i am unable to work my first priorty, then 2nd priorty, etc. Any ideas?