Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order By In Union Query 1

Status
Not open for further replies.

WarrenTheWindmill

Programmer
Sep 8, 2000
18
GB
I am using the dummy union workaround (using Where 0=1) to do a Select Distinct.
My problem is that I have a customer group sorted in ascending order on the report and Crystal is inserting an Order By clause at the end of the query in the form TABLENAME.FIELDNAME

When I run the report I get Oracle error 00904 "Invalid Column Name"

I've tried to figure out why, using PL/SQL developer to run the query, and discovered that if I remove the TABLENAME from the Order By clause it works fine.

Obviously I can't prevent CR8.5 from inserting this Order By in the form it does, (or can I?) so is there anything I can do to solve this problem without getting rid of my ascending order on customer?

Or is this a problem with the workaround which doesn't have another workaround to solve it? :)

Thanks in advance
 
Change the sorting in Crystal Reports from Ascending order to Original order, so it doesn't add an Order by clause with the group.
Then, manually add an Order by clause in the SQL statement. Remember that you have to use a numeric reference for the column name ie Order by 6 ASC, 5 DESC when you have a set operator like union. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top