title: Order By ERROR , not showing
body: <blockquote>
    <p>-- Trying to sort data using ORDER by with 2 SUBSTITUTION VARIABLE , but not working , problem is included below the thread.</p>
  </blockquote>
  
  <p>Table: users</p>
  
  <pre><code>CREATE TABLE users
  ( 
  user_id VARCHAR(5) ,
  user_name VARCHAR(30),
  CONSTRAINT pk_users PRIMARY KEY(user_id)
  )
  
  /
  INSERT INTO users
  VALUES ('U01','User1')
  /
  INSERT INTO users
  VALUES ('U02','User2')
  /
  </code></pre>
  
  <p>Table: staffaccount</p>
  
  <pre><code>CREATE TABLE staffaccount
  (
  staffaccount_id VARCHAR(5) ,
  user_id VARCHAR(5) ,
  CONSTRAINT pk_staffaccount PRIMARY KEY(staffaccount_id),
  CONSTRAINT fk_staffaccount1 FOREIGN KEY (user_id) REFERENCES users(user_id)
  )
  /
  INSERT INTO staffaccount
  VALUES ('STF01','U01')
  /
  INSERT INTO staffaccount
  VALUES ('STF02','U02')
  /
  </code></pre>
  
  <p>Table: location</p>
  
  <pre><code>CREATE TABLE location
  (
  location_id VARCHAR(5),
  location_name VARCHAR(25) NOT NULL,
  CONSTRAINT pk_location PRIMARY KEY(location_id)
  )
  /
  INSERT INTO location
  VALUES ('LOC01','Staff Toilet')
  /
  INSERT INTO location
  VALUES ('LOC02','Staff Office')
  /
  INSERT INTO location
  VALUES ('LOC03','Staff Meeting Room')
  /
  INSERT INTO location
  VALUES ('LOC04','Staff Hall')
  /
  </code></pre>
  
  <p>Table: bookingstaff</p>
  
  <pre><code>CREATE TABLE bookingstaff
  ( 
  staffaccount_id VARCHAR(5),
  location_id  VARCHAR(5),
  timebooked TIMESTAMP,
  usages VARCHAR(25)
  )
  
  /
  INSERT INTO bookingstaff
  VALUES ('STF01','LOC01',TIMESTAMP'2018-01-01 10:00:00','Pee')
  /
  INSERT INTO bookingstaff
  VALUES ('STF02','LOC02',TIMESTAMP'2018-01-02 10:00:00','Writing')
  /
  INSERT INTO bookingstaff
  VALUES ('STF01','LOC03',TIMESTAMP'2018-01-05 10:00:00','Meeting')
  /
  INSERT INTO bookingstaff
  VALUES ('STF02','LOC04',TIMESTAMP'2018-01-12 10:00:00','Dancing')
  /
  INSERT INTO bookingstaff
  VALUES ('STF01','LOC02',TIMESTAMP'2018-02-01 10:00:00','Writing')
  /
  INSERT INTO bookingstaff
  VALUES ('STF02','LOC03',TIMESTAMP'2018-02-02 10:00:00','Meeting')
  /
  INSERT INTO bookingstaff
  VALUES ('STF01','LOC02',TIMESTAMP'2018-02-15 10:00:00','Writing')
  /
  INSERT INTO bookingstaff
  VALUES ('STF02','LOC04',TIMESTAMP'2018-03-01 10:00:00','Dancing')
  /
  INSERT INTO bookingstaff
  VALUES ('STF01','LOC03',TIMESTAMP'2018-03-02 10:00:00','Meeting')
  /
  </code></pre>
  
  <blockquote>
    <p>On the above is all my table query, try to use substitution variable
    to display data. Code below</p>
  </blockquote>
  
  <pre><code>SELECT u.user_name,l.location_name,b.usages,to_char(cast(b.timebooked as date),'DD-MM-YYYY')as "DATE"
  FROM staffaccount s
  JOIN bookingstaff b
  ON b.staffaccount_id = s.staffaccount_id
  LEFT OUTER JOIN users u
  ON u.user_id= s.user_id
  LEFT OUTER JOIN location l
  ON l.location_id= b.location_id
  WHERE l.location_name LIKE '%Staff%'
  AND timebooked
  BETWEEN date&amp;
  AND date&amp;
  </code></pre>
  
  <blockquote>
    <p>with the code, here is the result for it. (first substitution
    variable: '2017-01-01' , second substitution variable:'2018-02-10')</p>
  </blockquote>
  
  <p><a href="http://prntscr.com/iztftx" rel="nofollow noreferrer">http://prntscr.com/iztftx</a>  &lt; Result displayed with myOra</p>
  
  <blockquote>
    <p>But when i tried to add ORDER by usages, it will show error.</p>
  </blockquote>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Never allowing me to enter second substitution variable</p>
  </blockquote>