Akasha Posted September 24, 2007 Share Posted September 24, 2007 Hello,i'am having a problem with my sql query. I use ASP to read my table.When I use the order by my where part doesn't work anymore.Why is did happining?? rs2.Open "SELECT * FROM Table1 where mesnum >= "& beginmes &" or mesnum <= " & endmes & " order by mesnum desc", conn,1,1 mesnum is my Key Element.When i remove the order by part its working fine, but the data is in the wrond order ( it must be asc in stead of desc)thats why i am using the order by part. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 24, 2007 Share Posted September 24, 2007 ORDER BY doesn't have anything to do with the WHERE clause. There is probably something in the endmes variable that is causing the query to fail. Link to comment Share on other sites More sharing options...
Akasha Posted September 25, 2007 Author Share Posted September 25, 2007 ORDER BY doesn't have anything to do with the WHERE clause. There is probably something in the endmes variable that is causing the query to fail. Thnx i checked the query and changed OR into AND and now its working fine . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.