Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula help - Crystal 9 Post Reply Post New Topic
Author Message
JeffS23
Newbie
Newbie
Avatar

Joined: 02 Nov 2007
Location: United States
Online Status: Offline
Posts: 8
Quote JeffS23 Replybullet Topic: Formula help - Crystal 9
    Posted: 02 Nov 2007 at 10:59am
Using Crystal 9
 
Formula help needed. Currently, I am using the following simple formula:
 
@Hours
{Data.ApptTime} / 60
 
I modified the SQL in my report that will throw a curve ball to this formula. I am currently wanting to factor in these two additional fields:
 
{Data.ApptKind}
{Data.Column}
 
What I would like to have is to only calculate the hours (@Hours) when {Data.ApptKind} = 1 and {Data.Column} = 1.
 
I will have intstances were these two columns will be something other than 1, however I do not want them factoring into my original formula. Any help is deeply appreciated.
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 02 Nov 2007 at 12:20pm

You should be able to add an if statement to your @Hours formula

 
It might look something like this:
 
IF {Data.ApptKind} = 1 AND {Data.Column} = 1 THEN
{Data.ApptTime} / 60;
 
Hope this is of a help
 
Regards,
 
John W.
IP IP Logged
JeffS23
Newbie
Newbie
Avatar

Joined: 02 Nov 2007
Location: United States
Online Status: Offline
Posts: 8
Quote JeffS23 Replybullet Posted: 02 Nov 2007 at 12:50pm
When I try your suggestion, I get an error message on the {Data.Column} = 1. It is telling me "A string is required here".
 
It is doing it on the 1.
 
 
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 02 Nov 2007 at 1:52pm
Try putting quotes around the 1.  Use "1" or '1'  and see if that helps.
 
John W.
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.