Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Chicago, Illinois, USA
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Question (97)

    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

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Question (97)

    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.

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Chicago, Illinois, USA
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query Question (97)

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

Posting Permissions

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