Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Is a Formula Field the right place to do this? Post Reply Post New Topic
Author Message
claymohr
Newbie
Newbie
Avatar

Joined: 03 Mar 2008
Location: United States
Online Status: Offline
Posts: 2
Quote claymohr Replybullet Topic: Is a Formula Field the right place to do this?
     Posted: 03 Mar 2008 at 3:30pm
I'm a crystal novice - so this might be a breeze for lots of you here.

I have created an sql query that contains all the information I need for my report.
This sql query contains a "part number" and a "customer catalog number".

I thought I should create a formula field that would print in the Details section of my report.

I thought I would create a formula field called "partnumber" with a formula that went something like:

if IsNull({CATALOG_NUMBER]) then {PART_NUMBER} else {CATALOG_NUMBER}

So, basically, if the catalog_number is blank, return the data in the part_number field - else - return the data in the catalog_number field.

But this just doesn't seem to be a syntax that Crystal likes.

Am I even in the right area?

Does anyone just have one bullet? Just one. For me.


IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 04 Mar 2008 at 12:04am
What is the syntax error? The error I see right away is that you need "}" after Catalog_Number and you have "]". Also, Part_Number and Catalog_Number must be the same data types. Also, for field names you need to specify the table name in front of the field. E.G.
{Inventory.Catalog_Number}
You should check out my book as well. I have three chapters dedicated to how to write formulas and tips and tricks that the experts use.

 Crystal Reports Encyclopedia
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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