Print Page | Close Window

how to multipy a currency

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=8624
Printed Date: 14 May 2024 at 5:58am


Topic: how to multipy a currency
Posted By: _Wired_
Subject: how to multipy a currency
Date Posted: 11 Dec 2009 at 6:27pm
i created a formula to multipy a currency.. but it says >>> ("number is required")

but when i change the data type on my database to a number.. my formula is working... how come when it was a currency.. it doesn't work?



Replies:
Posted By: lockwelle
Date Posted: 14 Dec 2009 at 6:11am
it probably depends on what the output looks like. If the output has commas and a dollar sign, CR probably sees it as a string.  Looking in SQL Server, there isn't a currency type...there is money, but it just returns a number.
 
So it all comes down to what the data looks like and how CR interprets it.


Posted By: _Wired_
Date Posted: 15 Dec 2009 at 4:23pm
ohh ic.. im using access 2003 as my DB... the output has a dollar sign on it.. is there a way to remove the sign?
or is there a alternative way to obtain what i want to do?


Posted By: lockwelle
Date Posted: 16 Dec 2009 at 6:08am
you could strip off the first character by using mid({table.field}, 2) and then taking the value of that val(mid({table.field},2)) this will give you a number.  I believe that val will translate/remove the comma that exist like 1,111.11.
 
HTH



Print Page | Close Window