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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REPORT PROBLEM 1

Status
Not open for further replies.

lode

Programmer
Nov 8, 2001
208
BE
Hi,

I made a datareport in VB6 (not a crystal report).
There are some fields who contain a boolean-value.
Instead of a -1 or 0 on my report I want a Yes or No.
Is that possible with the datareport ?

Thanx.
 
Try this to place expression below
in place of the field in the report

IIF(Field = -1, "No", "Yes")
 
Hi there,

Thanks for your reply.

How can i insert a control that accepts an expression like yours.
As far as I know, i can only insert datafields, and some
function controls but not an expression, or am i wrong ??

Lode
 
I had the same problem, but I was getting my data through a SQL query. If you are using SQL try something like:

select substring('Supply Fitted',(7*(fitted)),7) as isfitted, contractid from tblcontracts where ....

In my DB, fitted is a bit field (returns 1 for true), so substring as above returns first half or second half of 'Supply Fitted' as required

Check SQL BOL for substring Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
It's really quite simple and there is no need to play with SQL or IIF functions.

In the DataFormat property of the report control select a format type of Boolean. You can now select a value to display for a True Value, a False Value, and a Null Value.

 
Hi all,

Thanks very much for your reply.
The solution by aco2x is great, simple but effective and deserves a star.
Thanks very much to all of you !!!!!!!!!!

Lode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top