mysql,介于和限制之间

I want to get all the rows between a certain date interval , with the result set being at most 50 records. What can be the query ? I continuously getting errors on:

$sql = "SELECT DISTINCT userId FROM ".$TableName.
       " where time BETWEEN (NOW() - INTERVAL "
       .$USER_COUNT_DURATION.
       " MINUTE AND NOW())  LIMIT 0, ".$limit." ;";

looks like paranthesis problem. "MINUTE AND NOW())" should be "MINUTE) AND NOW()"

$sql = "SELECT DISTINCT userId FROM ".$TableName." where time BETWEEN (NOW() - INTERVAL ".$USER_COUNT_DURATION." MINUTE) AND NOW() LIMIT 0, ".$limit." ;";