Print Page | Close Window

Pb SUM function

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2139
Printed Date: 17 Apr 2025 at 12:21pm


Topic: Pb SUM function
Posted By: BAZ187REM
Subject: Pb SUM function
Date Posted: 25 Jan 2008 at 6:10am
Hello everyone !!

 I try to use CR in VS 2008 (VB .net) and I've got a problem while using SUM in formula Fields.

 I would like to make the SUM of one field (montant) in a table (courses) but all it says when I save is "there is an error in this formula". How can I do to get the SUM of my field please ??

 Thanks

 Ps : I've try in the formula workshop :

code1

Sum ({COURSES.MONTANT})

code 2

Sum ({COURSES.MONTANT});






Replies:
Posted By: hilfy
Date Posted: 25 Jan 2008 at 3:41pm
What type of database are you using?  What type is the field in the database?  Is it a number field or is it a string (char or varchar) field?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: BAZ187REM
Date Posted: 26 Jan 2008 at 2:47am
I'm using Oracle database and my fields "montant" is define as String because in Oracle Express there are not single type. So I've to use a String type to save my data.

Table COURSES :

Column NameData TypeNullableDefaultPrimary Key
DATE_COURSESDATENo - -
NOM_ALIMENTSVARCHAR2(4000)No - -
PRIX_ALIMENTSVARCHAR2(4000)Yes - -
QTEVARCHAR2(4000)Yes - -
MONTANTVARCHAR2(4000)Yes - -


1 - 5

< ="" ="text/">

< name="p_arg_names" value="11141129549203626" =""> < name="p_t01" value="15347" id="OB__NAME" ="">
< name="p_arg_names" value="11143605700225196" =""> < name="p_t02" value="1201344102359" id="P0_PPRTIMESTAMP" ="">




-------------
XP ultimate
Visual Studio 2008 (VB.NET)
Oracle Ex



Posted By: hilfy
Date Posted: 27 Jan 2008 at 5:40pm
Can you define montant as a number instead of as a varchar?  If not, you'll have to use a formula to convert it to a number - something like this:
 
If IsNull({COURSES.MONTANT}) then 0 else ToNumber({COURSES.MONTANT})
 
You'll then sum the formula instead of the field.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: BAZ187REM
Date Posted: 29 Jan 2008 at 11:57am
Tongue Thanks Smile It work great 

-------------
XP ultimate
Visual Studio 2008 (VB.NET)
Oracle Ex




Print Page | Close Window