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!

Need to SUM fields that are defined as VARCHAR2 1

Status
Not open for further replies.

gritz

Programmer
Apr 24, 2003
14
US
I am using Oracle Reports 6i, and I am trying to SUM fields that are selected from a database. Although the fields are defined as VARCHAR2, they usually contain a number. I tried to convert the fields using to_number in the SELECT statement, but the report prints a box with an X in it, and the propery pallette says the source of the field is <null>. Is there any way to get a sum on these fields?
 
If in your select statement, you take an existing element that is already on your canvas and wrap a function around it, you need to give that an alias of it's original name. That way the property pallete will remain unaffected. Since it lost the association you will need to go to the property pallete and reselect the TO_NUMBER column as the field's source.

Hope this helps.

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML for readability. Thanks![sup]
 
Hi there,

In the Data Model, try creating a Summary Column and set the 'source' property to show the table column which is to be summarised. Then, in the layout set the 'source' property of the field to this summary column.

Hope this works.

Regards
Kanchana Pillai
 
If you use the following the syntax, it will compensate for null values in your report.

SUM(NVL(AMOUNT,0)).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top