Forums: SQL command for between two values - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

SQL command for between two values Rate Topic: -----

#1 User is offline   Graeme Forrester 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 98
  • Joined: 14-July 06
  • Location:Australia

Posted 05 November 2006 - 09:04 AM

Hi,
I have a table events with
event 'id'
staffid
studentid
topic
eventdes
yearlev

what is the sql descriptor for between 0 and 6 as well as equal to?
I have found < and also > as well as the equal but not between two values.
0

#2 User is offline   thesofa 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 650
  • Joined: 24-February 06
  • Gender:Male
  • Location:NE England

Posted 05 November 2006 - 12:57 PM

View PostGraeme Forrester, on Nov 5 2006, 09:04 AM, said:

Hi,
I have a table events with
event 'id'
staffid
studentid
topic
eventdes
yearlev

what is the sql descriptor for between 0 and 6 as well as equal to?
I have found < and also > as well as the equal but not between two values.

Hi
`event`.`yearlev` BETWEEN  '1' AND '3'

will pick up 1, 2 and 3

It appears in the coded pages as yearlev>=1 and yearlev<=3
so when you start hacking, you may not find "between"
HTH
"Make something fool-proof and they will make a bigger fool"
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users