Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013
    Posts
    11

    Unanswered: ORA-00933: SQL command not properly ended

    I am trying to set up the query so that it displays all orders from 2012.

    I've got this so far:
    Code:
     where   *, "DATE_ORDERED" >= to_date ('01/01/2012', 'dd/mm/yyyy')AND order_date <= to_date(''12/12/2012', 'dd/mm/yyyy')
    I think its because of the >=to_date but cannot figure it out.
    Last edited by MicroB; 03-04-13 at 13:57.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    You have an invalid comma after the first condition in the WHERE clause.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    In your second to_date, you have two quotes before the date string and break yourself of the habit of using double quotes around everything. It will come back to haunt you. and the year ends on 12/31/2012, not 12/12/2012.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    This is what your current code look like (you modified the original message after two replies were post, so I have no idea what the original code looked like):
    Code:
    where   *, "DATE_ORDERED" >= to_date ('01/01/2012', 'dd/mm/yyyy')
      AND order_date <= to_date(''12/12/2012', 'dd/mm/yyyy')
    Where did you find such a syntax? What is
    Code:
    where *,
    supposed to mean?

    Did you read what you wrote before posting such a mess over here?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •