Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Formula Help? Post Reply Post New Topic
<< Prev Page  of 2
Author Message
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Posted: 25 Feb 2009 at 6:50am

I tried making the adjustment as you suggested to no avail, same error. Forgive my ignorance but how does one initialize SomeVar before use?

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 25 Feb 2009 at 6:53am
:= is the assignment operator.
 
I am at a loss, the formula should work.  I would think that currency/money would be OK, but Crystal can be funny.
 
Last thought, try val({table.field}).  Val will convert to a number...maybe it will work....
 
Hope this helps
IP IP Logged
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Posted: 25 Feb 2009 at 7:06am
I see. Darn Crystal...) I inserted val in front of {tblQuotes.TotalNetSell} and it highlights the field and complains "The remaining text does not appear to be part of the formula".
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 25 Feb 2009 at 7:09am
did use ()?  I know I ask stupid questions, but when I do that on a formula, I get the same message.
IP IP Logged
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Posted: 25 Feb 2009 at 9:18am

You don't ask stupid questions...you're just verifying I'm following your instructions, I understand. Yep, I did use parentheses around the field and get the error. Below is the full formula I'm currently using for the totals.

WhilePrintingRecords;
shared numbervar SomeVar :=0;
 
If ({tblServiceOrders.RepToCredit} = [3, 280, 281])
and
not ({tblRepsfromAccount.FirstName} = ["Toshiba", "ABC"])
or
({tblRepsfromAccount.FirstName} = 'House') and isNull ({tblServiceOrders.RepToCredit})
then SomeVar := SomeVar + val({tblQuotes.TotalNetSell})
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 26 Feb 2009 at 6:12am
Sorry, it has me stumped.  It looks correct to me.
 
I would try playing with it to try and figure out what is going wrong.
 
maybe comment out the if statement and see if just the assignment is working...  just an idea of how to try and diagnose what is going wrong.
 
Or try a new formula which is simpler but uses the same SomeVar variable.
 
Sorry I couldn't help more.
IP IP Logged
psalm19
Groupie
Groupie
Avatar

Joined: 19 Feb 2009
Online Status: Offline
Posts: 48
Quote psalm19 Replybullet Posted: 26 Feb 2009 at 8:45am
Ok, thank you very much for all you help; atleast you got me moving in the right direction!
 
Thanks again!!!
IP IP Logged
<< Prev Page  of 2
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.031 seconds.