Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Dynamic division forumula
<< Prev
Page
1
2
of 2
Author
Message
rlivermore
Groupie
Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Posted: 14 Jan 2013 at 11:30am
That helps but when I create a new formula and attempt to save it, it complains.
shared numbervar mnths;
local numbervar x :=month({tblServiceOrders.DateReceived});
if x < 12 then
mnths := x +1;
<<< highlights the text below with error: remaining text does not appear to be part of formula >>>
else
mnths := 1;
mnths
IP Logged
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 14 Jan 2013 at 12:10pm
remove the semi colon after x + 1...I never remember if it is necessary or not on the first part of a if then else clause.
at least that is the first thing that I would try.
IP Logged
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 14 Jan 2013 at 12:12pm
The semi-colon goes at the end of the if statement (unless you have multiple statements embedded in then .. else clauses.
If it gets too complicated, I change over to Basic syntax. It is a lot easier for me to follow.
IP Logged
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 14 Jan 2013 at 12:33pm
yeah, basic is simple that way, but my brain is so used to CR syntax, that even though I program in basic, I find it a pain in CR.
I figure adding it can't hurt too much, if I get an error, I remove the semi-colon.
IP Logged
rlivermore
Groupie
Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Posted: 14 Jan 2013 at 1:11pm
Looks like removing the semi colon did the trick. I ran the report for last years data and it seemed to calculate correctly. Thank you for your help!
IP Logged
<< Prev
Page
1
2
of 2
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.