Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Eliminate some fields but not record in report

    Would like to list all records but if a boolean field is true not show certain fields such as address, city, state, zip. I can barely get started with this for this is what I have:

    SELECT Lastname, Firstname, NoAddress, Address, City, State, Zip
    FROM Members
    WHERE IIF(NoAddress,'', '')
    ORDER BY Lastname

    NoAddress is the boolean.
    Thanks

    Kim

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    First, are you doing this in Access or SQL Server? If it is Access, the simplest way to do this is a series of IIF() expressions that check the status of the boolean field. If it is true, then you can display either a Null value, or an empty text string (""). If it is SQL Server, TSQL makes this a fair bit more complicated, as you have to use CASE statements. Hope this helps - if you want more advice on the syntax, post back and I'm sure someone can assist you.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the reply. The light just went on with your suggestion. I was trying to do it with only one conditional statement and in the WHERE portion of the SELECT statement. It has to be with each field that is affected.
    Thanks

    Kim

Posting Permissions

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