Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-05-09 : 18:15:25
|
Craig writes "I have a page where i want to use a next/previous item function, based on the next item being the next price higher.
The only problem is that when i do this, it always just seems to go to mainly the largest or the smallest depending on which way you want it to go...
The model that i am using is SQL, blow is the code i am using to select the from the database:
******* Start of main bit ********
sSql = "SELECT * FROM salesprop" sSql = sSql & "" & srchcountry & "" sSql = sSql & "" & srchtown & "" sSql = sSql & "" & srchptype & "" sSql = sSql & "" & srchbed & "" sSql = sSql & " AND price " & idpos & "=" sSql = sSql & " " & price & "" set Rs = MyConn.Execute (sSql)
If (Rs.EOF = "True") Then redirectPage = "blank.asp?ID=" & id & "" else redirectPage = "details.asp?ID=" & Rs("propid") & "" end if Call Response.Redirect(redirectPage)
******* End ********
There are bits missing like "idpos" that is a querystring it can be either "<" or ">" u know to go greater than or less than...
But i guess u could get that bit, well i don't really wanna stump ya i actually wanted the help *lol*
Craig" |
|
|
|
|
|