Results 1 to 2 of 2
  1. #1
    rafnews is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2015
    Posts
    5

    Question return "text" when a table field contains 1

    Hello,



    it's been a long time since i did some SQL queries on MS Access, but i forgot how to do to return a text for each row (as field value) when a table field contains "1" as value ?
    for example i have a table named "products" with a field/column called "promotion". Sometime a product is promotional, so in this case, the "promo" column holds "1" as value.

    during a select on products table, how can i do to return "in promotion" (e.g.) if the column "promo" holds "1" for a product ?

    thx.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    IIf() expression in query or textbox:

    IIf([promo]=1, "in promotion", "something else")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-22-2014, 01:09 PM
  2. Replies: 3
    Last Post: 04-22-2013, 06:08 AM
  3. Replies: 5
    Last Post: 03-22-2013, 01:11 PM
  4. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  5. Replies: 4
    Last Post: 04-18-2012, 12:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums