Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Variables in Reports Post Reply Post New Topic
Author Message
stefshuuj
Newbie
Newbie
Avatar

Joined: 24 Feb 2009
Online Status: Offline
Posts: 9
Quote stefshuuj Replybullet Topic: Variables in Reports
     Posted: 02 Feb 2010 at 9:50pm
Hi All,
 
Here's what I am trying to do:
 
If Field1 contains word "Summer" then in column A put "Summer"
If Field2 contains word "Winter" then in column A put "Winter"
 
So far I have:
 
Local StringVar a;
if {Table.Field1} = "Summer" then a := "Summer"
if {Table.Field2} = "Winter" then a := a+"Winter"
It keeps telling me the second line is not part of the formula
 
Thanks in Advance for any help
 
Cheers
Stephen
Thanks in Advance
Stephen
"CR Newbie"
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 03 Feb 2010 at 2:14am
Hi,
 
That's because you don't have a ; at the end of the first If line.
The semi-colon says to a Crystal expression "keep on reading".
IP IP Logged
stefshuuj
Newbie
Newbie
Avatar

Joined: 24 Feb 2009
Online Status: Offline
Posts: 9
Quote stefshuuj Replybullet Posted: 03 Feb 2010 at 3:07am
Thanks DaveJWhite your a legend.
 
I have no programming language experience and am teaching myself crystal reports. I find its always these simple things I keep missing.
 
Appreciate the help.
 
Cheers
Stephen
Thanks in Advance
Stephen
"CR Newbie"
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 03 Feb 2010 at 3:27am
I still miss out the occasional ; and get that darned error!
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