Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Syntax Post Reply Post New Topic
Author Message
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Topic: Formula Syntax
    Posted: 13 Jun 2012 at 2:47am
I am still working on getting three different things to show from one field.

I have the formula of how i think it should read, but I am not a programer by any means, and I have only taken a 3 day beginner class. 


Here is the formula as I have it.   

if {WORKORDERSQUAWKS.LABORMETHOD} = "Time & Materials"
then   "Labor Rate:" totext {WORKORDERSQUAWKS.LABORPRICE}

If  {WORKORDERSQUAWKS.LABORMETHOD} = "Flat Rate"
"Labor Price:" totext {WORKORDERSQUAWKS.LABORPRICE}

If {WORKORDERSQUAWKS.LABORMETHOD} = "No Charge"
then "Labor Price: No Charge"


IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 13 Jun 2012 at 3:00am
I'd do it like this;
 
stringvar val:= totext({WORKORDERSQUAWKS.LABORPRICE});
 
select {WORKORDERSQUAWKS.LABORMETHOD}
case "Time & Materials": "Labor Rate: " & val
case "Flat Rate": "Labor Price: " & val
case "No Charge": "Labor Price: No Charge"
default: "Unknown";
 
Regards,
Ryan.


Edited by rkrowland - 13 Jun 2012 at 3:17am
IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 13 Jun 2012 at 8:55am

IP IP Logged
sri-knight22
Newbie
Newbie
Avatar

Joined: 06 Jan 2012
Online Status: Offline
Posts: 16
Quote sri-knight22 Replybullet Posted: 13 Jun 2012 at 8:56am
Thanks.  that did the trick  
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.016 seconds.