Re: order by in a union



In article <Jokfg.9183$lb.830635@xxxxxxxxxxxxxx>, Marc Miller says...
Hello all,

I am having a heck of a time getting a UNION to ORDER BY. I'm working with
SQL Server Reporting Services,
but even when I try the query in SQL*Plus, I receive the same error which is
'SQL command not properly ended'
and it point to the "O" in word "ORDER" on the last line of the query.

I've tried "ORDER BY project, accounting_date" and I've trime "ORDER BY 3,6"
and I've even tried just
"ORDER BY project", "ORDER BY d.project" and "ORDER BY 2". Same error each
time.

Here are my syntax (which work fine without the "ORDER BY " clause.

Select poh.SEGMENT1 AS PO_NUM, d.VENDOR_NAME,SUBSTR(d.project,1,3) || '-' ||

<snip>

AND po_distribution_id IS NULL order by accounting_date, project
ORDER BY project, accounting_date
/


2 order by clauses?

--

jeremy
.



Relevant Pages

  • Re: order by in a union
    ... Here's the real syntax: ... I am having a heck of a time getting a UNION to ORDER BY. ... SQL Server Reporting Services, ... Here are my syntax (which work fine without the "ORDER BY " clause. ...
    (comp.databases.oracle.server)
  • order by in a union
    ... I am having a heck of a time getting a UNION to ORDER BY. ... SQL Server Reporting Services, ...
    (comp.databases.oracle.server)
  • Re: order by in a union
    ... Here's the real syntax: ... I am having a heck of a time getting a UNION to ORDER BY. ... SQL Server Reporting Services, ... Here are my syntax (which work fine without the "ORDER BY " clause. ...
    (comp.databases.oracle.server)
  • Re: order by in a union
    ... Here's the real syntax: ... I am having a heck of a time getting a UNION to ORDER BY. ... SQL Server Reporting Services, ... Here are my syntax (which work fine without the "ORDER BY " clause. ...
    (comp.databases.oracle.server)
  • Re: Automatically Printing from SQL Reporting services
    ... Local printing will be in the next service pack. ... MVP SQL Server Reporting Services ... "Ernie" wrote in message ...
    (microsoft.public.sqlserver.programming)