Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crystal reports conditional value 1

Status
Not open for further replies.

mstepPCI

MIS
Jun 14, 2004
8
US
I dont have very much experience with crystal reports or this website so please don't flame. I was wondering if there was a way to test a database field to see if it is empty, and if it is then place a hardcoded string into a text box. If its not empty then place the value of the db field into the text box.

Something like

db field contains "coke"
drink: coke

db field contains ""
drink: No drink specified!


sorry for the basic question.
 
where exactly do i type this? I'm using crystal reports 8.5. THANKS
 
You have to create new formula and inside new formula type the following:

If Not (IsNull(db field) and Trim(db field)="") then
"drink:" + db field
Else
"drink: No drink specified!"

and put this formula in the detail section of the report.


I would advice you to take crystal reports I classes.

Srinath
srinath_p (at) yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top