Hi
I want to show a crystal report in my windows application.In my Access DataBase I have a column called Payment type and its type is number.(ie data in that column is stored as 0 or 1).If payment type is 0 I want to show it as a string called "Cheque" and if it is 1 I want to display "Cash" in my crystal report.How can I do it?

Thanx

Use Formula field or select Format Object menu option of context menu.

if col1=1 then "A" else "B"

thanx for the help Nichito.But I want to know how to give the formula?

Can you give me the syntax for the fomula?
thanx

See Post #3. It has a syntax of formula.

When I type this code in show formula
if({PAYMENT_MST.ChequeType})=0 then 'Crossed Cheque'
it gives a error message saying "the result of a selection formula must be a boolean"
Can you help me with this?

if {PAYMENT_MST.ChequeType}=0 then 'Crossed Cheque' else 'Cash'

Non-numeric,

if {PAYMENT_MST.ChequeType}='0' then 'Crossed Cheque' else 'Cash'

Thanx
But still it displays the numbers ie 0 and 1
Have any idea where I have gone wrong?Thanx for taking trouble .

You have to drag a formula field into the display area of crystal report.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.