• Query Question (97)

    Author
    Topic
    #376636

    I have a select query where one of the fields is called value1. Value1 can be 0 or a value higher than 0. Is there a way to build an expression in another column in the query along that says if value1 = 0, then show 0, if value >0, then show 1. I want to be able to sort and group in a report based on if the data is for value1 is zero or or number higher than zero and this is one way I thought I might be able to do it.

    I hope that makes sense…

    Or, perhaps there is a better way to do it?

    TIA

    Thanks

    Viewing 0 reply threads
    Author
    Replies
    • #617545

      Assuming there are no values <0, in an empty column of the QBE grid place the following:
      YourNew Field: IIf([Value1]=0,0,1)
      You can replace YourNew Field with a more descriptive name.

      • #617566

        That is exactly what I was trying to get to but I had the syntax wrong. Works great. Thanks!

    Viewing 0 reply threads
    Reply To: Query Question (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: