Sort Function in Database Reports

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
psupgmer
Posts: 2
Joined: Wed Sep 05, 2012 4:33 pm

Sort Function in Database Reports

Post by psupgmer »

I am trying to create a report that sorts a sum of several fields from the query. The equation from the query is as follows:

"Table1"."PS #1" + "Table1"."PS #2" + "Table1"."PS #3"

When I create a report through the Wizard and ask it to sort this equation ascending, it doesn't import any of the data into the report.

Please help!!!
Openoffice 3.4.1 on MAC 10.7.4
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Sort Function in Database Reports

Post by Villeroy »

Do all sorting in the query.
And use an alias name for the calculated field.
SELECT *, "Table1"."PS #1" + "Table1"."PS #2" + "Table1"."PS #3" AS "Sum" FROM "Table1" ORDER BY "Sum" ASC
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
psupgmer
Posts: 2
Joined: Wed Sep 05, 2012 4:33 pm

Re: Sort Function in Database Reports

Post by psupgmer »

When I put this formula into the field in a query, it comes up with an error that the column is unknown. What am I missing?

Thanks!
Openoffice 3.4.1 on MAC 10.7.4
Post Reply