AllExperts > Ingres 
Search      
Ingres
Volunteer
Answers to thousands of questions
 Home · More Ingres Questions · Answer Library  · Encyclopedia ·
More Ingres Answers
Question Library

Ask a question about Ingres
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jean-Pierre Zuate
Expertise
Any questions about database Ingres (owned by Computer Associates then Ingres Corp) : - Ingres 6.4 - OpenINGRES from 1.0 to 2.0 - IngresII from 2.0 to 2.6 - Ingres R3, Ingres 2006 (Open Source version) - All tool around Ingres : ABF, Report Writer, Replicator, OpenROAD (3.5 to 2006), Ingres/NET Ingres/STAR, ...

Experience
16 years of computing experience as :
- AS400 programmer
- AIX / Ingres administrator and developer (OpenROAD and korn shell)
- Ingres DataBase Administrator
- Ingres expert - Data modelisation - ETL - Reporting - Many of Computer Associates sofwares - ITIL / CMDB / Change Management

Organizations
http://lafageconseil.fr

 
   

You are here:  Experts > Computing/Technology > Databases > Ingres > Report Writer - Sums of Absolute Values

Ingres - Report Writer - Sums of Absolute Values


Expert: Jean-Pierre Zuate - 12/15/2008

Question
QUESTION: Within the .FOOTER of an Ingres report, can I print the sum of absolute values of a numeric variable please, e.g. SUM(ABS(total)) ?

ANSWER: Hello,

The documentation say "yes you can", because I see examples like your's.

Extract from documentation (Character-based Querying and Reporting Tools
User Guide):
.footer report
.tab 10
.print 'TOTAL COSTS: ', sum("wholesale cost"),
('$------.zz')
.newline

Hope this help,
Jean-Pierre ZUATE
http://lafageconseil.fr

---------- FOLLOW-UP ----------

QUESTION: Thanks for your reply. However, as soon as I include the abs() function, I get this when the report runs:-
E_RW106D Bad column 'abs' specified for aggregate 'SUM'. Error occurred in
   footer text for 'report'. Line with error: 'println 'DEBIT TOTAL OF
   FILE:  ',SUM(ABS(goods))'.

Answer
As far as I know I suppose you can have 2 sql functions in an expression for .PRINTLN but there are no example like that in the documentation (only with 1 sql function).

Please try , as a workaround, to embed the ABS function directly in the SELECT ...

Hope this help,
Jean-Pierre ZUATE

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.