Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Case VS If Post Reply Post New Topic
Author Message
jman
Newbie
Newbie
Avatar

Joined: 09 Nov 2012
Location: United States
Online Status: Offline
Posts: 2
Quote jman Replybullet Topic: Case VS If
     Posted: 09 Nov 2012 at 5:56am
I am wondering if there is a speed difference in the way Crystal handles case statements as opposed to if/then/else. Will a case statement process faster or slower assuming the condtional requirements are the same?
Wish it was Crystal Clear
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2012 at 11:59am
It depends on what it is doing
Below is from Crystal Help...
 

Key uses of SQL Expression fields

To maintain optimum report processing speeds, avoid using formulas (whether Crystal or Basic syntax) within record selection formulas. Instead, replace the original formula with an equivalent SQL Expression field, and then incorporate the SQL Expression field into your record selection formula. Doing so will greatly improve the chances of your record selection being pushed down to the server.

In addition, avoid sorting, grouping, or totaling on a formula field (whether Crystal or Basic syntax). Instead, replace the original formula field with an equivalent SQL Expression field, and then sort, group, or total on the SQL Expression Field. Again, this will greatly improve the chances of the processing being done on the server.

Finally, if your database supports Case Logic, and your report needs to summarize an If-Then-Else formula calculation, replace the formula with an SQL Expression field. In such cases, SQL Expression fields enable Crystal Reports to perform the report's grouping on the server. For more information, see Using SQL Expression for Case Logic"

IP IP Logged
jman
Newbie
Newbie
Avatar

Joined: 09 Nov 2012
Location: United States
Online Status: Offline
Posts: 2
Quote jman Replybullet Posted: 12 Nov 2012 at 2:06am
Thanks. That was very helpful.
Thumbs%20Up
Wish it was Crystal Clear
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