Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    212

    Unanswered: Derived Table Produces ODBC Syntax Error

    Hi,

    I am trying to query a sybase databse via a ODBC ASE connection within SSRS.

    However I get the following error when I attempt a query that uses a derived table:
    Code:
    SELECT application_name
    FROM ( SELECT CASE WHEN name IN ('appliction_1', 'application_2') THEN 'My Application'
                       WHEN name IN ('appliction_3', 'application_4') THEN 'Your Application'
                       ELSE 'Other Application' END AS application_name
           FROM tbl_applications
           ORDER BY name ) x
    WHERE application_name != 'Other Application'

    ERROR [42000] [MERANT][ODBC Sybase ASE driver][SQL Server]Incorrect syntax near 'FROM'.

    Any ideas? I've tried SELECT x.application_name but I still get the same error.

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Remove the order by clause

Posting Permissions

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