Jump to content

Where doesn't work when order by is activated


Akasha

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...