Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal Formula HELP Post Reply Post New Topic
Author Message
AndrewM
Newbie
Newbie
Avatar

Joined: 06 May 2010
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote AndrewM Replybullet Topic: Crystal Formula HELP
     Posted: 06 May 2010 at 3:07am
Hi,
 
I am stuck with a formula!
 
I want to say if the field {mac.drug_description} does not start with "WARFARIN" then {mac.start_date} will be displayed
 
If {mac.drug_description} startswith "WARFARIN" then {mac.start_date} will not display
 
not({mac.drug_description} startswith "WARFARIN") then {mac.start_date}
 
else
{mac.start_date}
 
 
I hope that makes sense to someone
 
 
Cheers,
Andrew
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 May 2010 at 3:10am
if left({mac.drug_description}, len("warfarin")<>"WARFARIN" then
 {mac.start_date}
 
 
done.  if it doesn't start with that, then nothing will be displayed.
 
HTH
IP IP Logged
AndrewM
Newbie
Newbie
Avatar

Joined: 06 May 2010
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote AndrewM Replybullet Posted: 06 May 2010 at 3:14am

Hi thank you soooo much for your quick response

When i insert the formula i get the error message "The ) is missing."
 
Andrew Smile
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 May 2010 at 4:05am
There was just a missing parenth to close the LEFT() portion...
as a new formula field
if left({mac.drug_description}, len("warfarin"))<>"WARFARIN" then
 {mac.start_date}
 
or if it is just display/suppress place the {mac.start_date} on the canvas
right click
select format field
common tab
suppress formula box
{mac.drug_description} startswith "WARFARIN"
 


Edited by DBlank - 06 May 2010 at 4:06am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 May 2010 at 4:48am
Didn't know there was a startswith keyword... never had much need of it, but something to keep in mind.
 
I like the suppression idea myself, I was just answering the question...I have a formula and it's not working....
IP IP Logged
AndrewM
Newbie
Newbie
Avatar

Joined: 06 May 2010
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote AndrewM Replybullet Posted: 07 May 2010 at 1:44am
Hey guys thank you soooooo much for your help its working perfectly now
 
Andrew Big%20smile
IP IP Logged
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