Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Pb SUM function Post Reply Post New Topic
Author Message
BAZ187REM
Newbie
Newbie
Avatar

Joined: 25 Jan 2008
Online Status: Offline
Posts: 3
Quote BAZ187REM Replybullet Topic: Pb SUM function
    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});



IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet 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
IP IP Logged
BAZ187REM
Newbie
Newbie
Avatar

Joined: 25 Jan 2008
Online Status: Offline
Posts: 3
Quote BAZ187REM Replybullet 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

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet 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
IP IP Logged
BAZ187REM
Newbie
Newbie
Avatar

Joined: 25 Jan 2008
Online Status: Offline
Posts: 3
Quote BAZ187REM Replybullet Posted: 29 Jan 2008 at 11:57am
Tongue Thanks Smile It work great 
XP ultimate
Visual Studio 2008 (VB.NET)
Oracle Ex

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.
HOME | FREE EBOOK | PROGRAMMING GUIDE | PURCHASE | REVIEWS | CONTACT ME | FAQ | LINKS | CLICK PLAYS | COACH FORUMS | TROPICAL FISH

© 2004-2024 Brian Bischof. All Rights Reserved.