0

please help me regarding this block of code... i have a table that has these fields (cCLID,cCLID,nLID) nLID is a numeric, but when I sort it the result show this sequence (1,10,2,3,4,5...) but i want to sort it this way (1,2,3,4,5...10)

sDataSet.Tables(tmp(0).Name).Select("cCLID='" & _cCLID.Text_Value & "'", "Convert(Numberic(18,0),nLID) ASC")

1 Answer 1

1

Use a temp-Field like Sort_NLID and fill it in SQL like:

CASE WHEN ISNUMERIC(NLID) = 1 THEN CAST(NLID AS INTEGER) ELSE -1 END AS Sort_NLID

then sort

sDataSet.Tables(tmp(0).Name).Select("cCLID='" & _cCLID.Text_Value & "'", "Sort_NLID, nLID") 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.