| |
   
Morovia.com Home | Fonts | Components | Labeling | Library | Order | Forum
  Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Crystal Reports
 Community Forum : Crystal Reports
Subject Topic: Calculation Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
anatasia
Newbie
Newbie
Avatar

Joined: October 16 2006
Location: Singapore
Posts: 1
Posted: October 16 2006 at 9:50pm | IP Logged Quote anatasia

Hi, Im having a difficulty to sum up the total amount with different currency. I would appreciate for any advise. Here with my example:

eg. if currency = EUR then
a = EUR100 * 2.02
else if currency = RM then
b = RM100 * 0.42
else if currency = SGD
c = SGD 100 * 1
and i want to sum up all the converted amount a+b+c.

I wrote the codes as below, but it only returned 1 converted amount if the first currency type was found.

CurrencyVar Total;
CurrencyVar AUD;
CurrencyVar EUR;
CurrencyVar GBP;
CurrencyVar RM;
CurrencyVar SGD;
CurrencyVar THB;
CurrencyVar USD;


if {GLDebit.OriginCurr} = "AUD" then
(AUD := {tbl_ValueInfo.AUG}* Sum ({@SalesValueAUD}, {tbl_Posting.ID});
Total := Total + AUD)
else if {GLDebit.OriginCurr} = "EUR" then
(EUR := {tbl_ValueInfo.EUR}* Sum ({@SalesValueEUR}, {tbl_Posting.ID});
Total := Total + EUR)
else if {GLDebit.OriginCurr} = "GBP" then
(GBP := {tbl_ValueInfo.GBP}* Sum ({@SalesValueGBP}, {tbl_Posting.ID});
Total := Total + GBP)
else if {GLDebit.OriginCurr} = "SGD" then
(RM := {tbl_ValueInfo.SGD}* Sum ({@SalesValueSGD}, {tbl_Posting.ID});
Total := Total + SGD)
else if {GLDebit.OriginCurr} = "USD" then
(SGD := {tbl_ValueInfo.USD}* Sum ({@SalesValueUSD}, {tbl_Posting.ID});
Total := Total + USD)
else if {GLDebit.OriginCurr} = "RM" then
(RM := {tbl_ValueInfo.RM}* Sum ({@SalesValueRM}, {tbl_Posting.ID});
Total := Total + RM)
else if {GLDebit.OriginCurr} = "THB" then
(THB := {tbl_ValueInfo.THB}*Sum ({@SalesValueTHB}, {tbl_Posting.ID});
Total := Total + THB)





Anatasia

Back to Top View anatasia's Profile Search for other posts by anatasia
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost 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.3125 seconds.