Search between to values

Results 1 to 2 of 2

Thread: Search between to values

  1. #1
    Join Date
    Dec 1969

    Default Search between to values

    I have a variable that holds integer value eg var=4<BR>how can i define another variable that is "-2 AND +2" of var<BR><BR>thats what i did<BR>a = "var" - 2<BR>b = "var" + 2<BR>anotherVar = a "AND" b<BR><BR>which is not right... basically i want to create sql statement that searches between to values

  2. #2
    Medieval Dude Guest

    Default RE: Search between to values

    Try this:<BR>SELECT * FROM mytable WHERE myvalue BETWEEN a AND b

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts