Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversion

Status
Not open for further replies.

BadPenguin

Programmer
Nov 5, 2004
11
US
I am needing to write a report that essentially is a receipt. Our database stores a discount as a string. Depending on if the discount is a percent or dollar amount, the date is stored with a preceding identifier. For example:

$10 for a dollar amount discount
%15 for a percentage discount.

How can I check for the type of discount in crystal reports and then based on the type of discount, convert it to a useable number (basically strip the beginning character once it is identified)

Thanks for any help offered.
 
Try:

if left({table.string},1) = "$" then tonumber(mid({table.string},2)) else
if left({table.string},1) = "%" then tonumber(mid({table.string},2))/100

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top