Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: problem with formula - 2 Post Reply Post New Topic
Author Message
Barb
Newbie
Newbie


Joined: 15 Nov 2011
Online Status: Offline
Posts: 29
Quote Barb Replybullet Topic: problem with formula - 2
     Posted: 20 Dec 2011 at 11:26pm
Hello again
 
 
Need help with another formula - I am just not good at it. :(
 
This is my formula for Amount column:
 

    if {?Currency} = "L" then

    formula = {Command.LineTotal}

    else

    formula = {Command.SysTotal}

    end if

 
I need to add to it that if an Account ="207000" then   
 formula = {Command.VATLineTotal}

  else

 formula = {Command.VATSysTotal}.

 
Sounds easy but which ever way I link the two formulas the results are still from the first formula. How can I make this one account to pick up amount from different fields?
 
Please help!
 
THANK YOU
 
   
Many thanks
Barb
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 21 Dec 2011 at 2:52am
I've not tested this but try
 
if  {?Currency} = "L"
then
     (if  Account ="207000" then formula := {Command.VATLineTotal}
     else formula := {Command.LineTotal} )
else   //{?Currency} <> "L" 
     (if  Account ="207000" then formula := {Command.VATSysTotal}
     else formula := {Command.SysTotal}
IP IP Logged
Barb
Newbie
Newbie


Joined: 15 Nov 2011
Online Status: Offline
Posts: 29
Quote Barb Replybullet Posted: 21 Dec 2011 at 4:37am
I get an error message where the first bracket opens "a statement is expected here", so I tried to slightly adjusted it
but could not get it to work. Any chance you could look at it againplease?
Many thanks
Barb
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Dec 2011 at 5:54am

   what do you want this formula to do?


IP IP Logged
Barb
Newbie
Newbie


Joined: 15 Nov 2011
Online Status: Offline
Posts: 29
Quote Barb Replybullet Posted: 21 Dec 2011 at 6:03am
if you select Local currency then the formula should pick up linetotal, if it is not Local curency then pick up systotal that should apply to all accounts except one, 207000. Under this acccount if you select local currency then pick up VATlineTotal otherwise VAtsdystotal.
is it possiable?
Many thanks
Barb
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Dec 2011 at 6:10am

    if {?Currency} = "L" then

    formula = {Command.LineTotal}

    else if {?Currency} <> "L" then

    formula = {Command.SysTotal}

    else if

 Account ="207000" and {?Currency} = "L" then   
 formula = {Command.VATLineTotal}

  else if {?Currency} <> "L" and Account ="207000" then

 formula = {Command.VATSysTotal}.

IP IP Logged
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