Results 1 to 5 of 5

Thread: [RESOLVED] How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    Resolved [RESOLVED] How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

    Hey there,

    I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".

    How can I change this so it displays "Yes" if true and "No" if False?

    Would be really grateful for any help.
    Thanks.

  2. #2
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

    hey just use a small if condition that checks whether the value of record is 0 or 1 and correspondingly display as true or false
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    Re: How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

    Quote Originally Posted by litlewiki
    hey just use a small if condition that checks whether the value of record is 0 or 1 and correspondingly display as true or false
    Could you by chance post the coding, or syntax, for the smallif condition?

  4. #4
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

    I don't know how you display the data, using SQL statements, or bound controls...

    With SQL statements, you do it like this:
    Code:
    SELECT IIF(my_bool_val = True, 'Yes', 'No') FROM my_table WHERE ..........etc....

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    Re: How to change Boolean field from displaying "0" and "-1" to "Yes" and "No"

    I found a solution: simply change the Format of the boolean in Properties, which allows you to state a value for True and for False.

    Nevertheless, thanks Wiki and Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width