title: Missing Keyword Error in Oracle - Wrong Syntax WHERE Expression
body: <p>I'm new to Oracle SQL, I'm being asked to do some scenarios to learn the different expressions and so on.</p>
  
  <p>I'm currently working on this statement but I keep having trouble with syntax and trying to get my expressions in the correct place.</p>
  
  <p>If you don't mind taking a look at what I'm doing wrong and helping me learn the correct syntax I'd appreciate it a lot.</p>
  
  <p>I have to find everything in the Sale, SaleDetail, OrderStatus, Warehouse, User and StockDetail tables.</p>
  
  <p>The fields I need to find are saleno, serialstart, serialend, the product description (label field), sale status (saleid (I think)), WarehouseName (WH.NAME)</p>
  
  <p>Here below is the code I've written so far.</p>
  
  <pre><code>SELECT
  S.SALENO,
  SD.SERIALSTART,
  SD.SERIALEND,
  SDT.LABEL,
  USR.USERNAME,
  WH.NAME
  FROM
  ITR_SALE,
  ITR_SALEDETAIL,
  ITR_ORDER,
  ITR_WAREHOUSE,
  ITR_USER,
  ITR_STOCKDETAIL
  JOIN ITR_SALE S
  JOIN ITR_SALEDETAIL SD ON S.ID = SD.SALENO
  JOIN ITR_WAREHOUSE WH ON SD.ID = WH.NAME
  JOIN ITR_ORDER ODR ON WH.ID = ODR.STATUSID
  JOIN ITR_USER USR ON ODR.ID = USR.USERNAME
  JOIN ITR_STOCKDETAIL ON USR.ID = SDT.LABEL
  WHERE S.LASTSTATUSCHANGETIME 
  BETWEEN ('2016-01-01 00:00:00' AND '2016-12-31 23:59:59')
  AND STATUSID = ('COMPLETED');
  </code></pre>
  
  <p>Below follows the error message</p>
  
  <pre><code>ORA-00905: missing keyword
  00905. 00000 -  "missing keyword"
  *Cause:    
  *Action:
  Error at Line: 21 Column: 1
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Finished code below, changed a few expressions and conditions.</p>
  
  <pre><code>SELECT
  S.SALENO,
  SD.SERIALSTART,
  SD.SERIALEND,
  SDA.LABEL,
  USR.USERNAME,
  WH.NAME
  FROM 
  ITR_SALE S
  INNER JOIN
  ITR_SALEDETAIL SD ON S.ID = SD.SALEID
  INNER JOIN
  ITR_ORDERSTATUS ODS ON SD.ID = ODS.ID
  INNER JOIN
  ITR_WAREHOUSE WH ON ODS.ID = WH.NAME
  INNER JOIN
  ITR_USER USR ON WH.ID = USR.USERNAME
  INNER JOIN
  ITR_STOCKDETAIL SDA ON USR.ID = SDA.LABEL
  WHERE 'DATE' BETWEEN '2016-01-01' AND '2016-12-31'
  AND S.STATUSID = '4';`
  </code></pre>