Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to use string functions to compare two string in crystal report to print conditional data ?

Posted on 2008-10-25
1
Medium Priority
?
9,120 Views
Last Modified: 2012-08-14
Hi,

I have following three fields in my table and there sample data
1) Address     = 123 Street, mycity
2) Bank           = TD Bank , branch 103 , Mississauga
3) Remarks     = Money deposit in Bank
I am using sql stored procedure to populate my data for cystal report.
I want to print only one field in my report: Address or Bank depending on my Remarks field data. If I have word "Bank" in my Remarks my Bank field will be print otherwise Address only.
How can I do that in crystal report? It easy to do in VB. I have found some crystal report function like InStr and StrComp but don't know how to use them. No example found.
Thanks


0
Comment
Question by:khalidsuhail
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 22806414
Create a formula field. and plsce it where you want the data to appear in your report.

If instr({Table.Remarks},"Bank")>0 then
{table.Bank}
else
{Table.Address}
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question