Order by clause in MSSQL

Hello,

I just had my database converted from Access to MSSQL, but now I run into a problem. MSSQL doesnt seem to be able to order by text. I really need to be able to do this. I used this clause with access:

SQL = "select * from members where status = 2 ORDER BY username asc;

How can I get this working in MSSQL?

Please hlp me!

Thanks!

That’s valid in MSSQL and it should work perfectly, provided it makes sense in your database..

You can not perform an ORDER BY on a text, ntext, or image field (those fields are actually pointers). From the context of your query, though, I’m guessing you probably don’t need the “username” field to be a MSSQL text field; change that field to a varchar(x) field and you’ll be fine. Text fields have different meanings in Access and MSSQL; in the former text fields refer to pretty much any field containing text, while in the latter they refer to large fields containing text.

Great mate! That’s it! Dumb-ass me overlooked it, so thanks for wakin me up! :smiley: