Jump to content


Photo

quick database syntax query


  • Please log in to reply
1 reply to this topic

#1 k4pil

k4pil
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 08 March 2006 - 06:03 PM

The below is not working

SELECT *
FROM activity
WHERE userID = 2 AND WHERE time
BETWEEN 19700101020000
AND 20060606000000

Im am trying to get all rows where userID is 2 and time is between those two numbers.

Any help?


ive somehow solved it by rearranging -

SELECT *
FROM activity
WHERE WHERE time
BETWEEN 19700101020000
AND 20060606000000
AND userID = 2

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 08 March 2006 - 06:09 PM

Remove the second "where":
[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM activity WHERE userID = 2 AND time BETWEEN 19700101020000 AND 20060606000000 [!--sql2--][/div][!--sql3--]

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users