Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formatting Formula Post Reply Post New Topic
Author Message
AndrewZ00
Newbie
Newbie


Joined: 23 Apr 2009
Location: United States
Online Status: Offline
Posts: 4
Quote AndrewZ00 Replybullet Topic: Formatting Formula
    Posted: 17 Nov 2009 at 1:20pm
ok so im kind of a noobi when it comes to crystal... and i tend to take the easy way out (for me anyway)...i write most of my reports in SQL server then just convert the parameters to crystal syntax etc...
i needed a report that would be a crosstab... 
 
BDM                 Recruiter                      Type                 Apr       May
Lingenfelter       Beedenbender              %APD             0.81     1.14
Lingenfelter       Beedenbender              %EPD              1.09     1.20
Lingenfelter       Beedenbender              APD                909      1362
Lingenfelter       Beedenbender              EPD                 1224    1432
Lingenfelter       Beedenbender              Goal                 1116    1189
 
 
So i wrote it out in sql first... the only problem is that the "TYPE" field needs to have different formats depending on the result... so where "Type" = %APD i have to format the corresponding numbers as percentages....
 
how or where can i put a formual that will only format those that are less then 2 into a percentage?
 
I hope that makes sense….
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Nov 2009 at 6:23am
if {table.Type} = "%APD" then
  format({table.field}, "#,##0.00")
else
  totext({table.field},0,"")
 
should do it.  You have to return the same type of value (in this case a string) on both sides of an if statement in CR
 
HTH
IP IP Logged
AndrewZ00
Newbie
Newbie


Joined: 23 Apr 2009
Location: United States
Online Status: Offline
Posts: 4
Quote AndrewZ00 Replybullet Posted: 18 Nov 2009 at 6:32am
Thank you so much!
 
phew...  if you dont use crystal every day it can sure be a fustrating pain the in the "you know what"
 
Thank you again!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Nov 2009 at 6:33am
glad to help
IP IP Logged
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.023 seconds.