Results 1 to 3 of 3
  1. #1
    hollyh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    3

    querying and converting text to numbers


    I inherited a database, so bare with me. The person who had this database before me

    -created a main table with a column SMOKING
    -linked to a query of another table
    called YNDK with ID autonumber, then yes..no..don't know

    I would like run a query to convert these values to either 2 for yes or 1 for no or null/blank

    IIf statements do not work. Any advice? Thanks.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    iif([SMOKING] = "No", 1, iif([SMOKING] = "Yes", 2, null))

  3. #3
    hollyh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    3
    i must be losing my mind

    thank you

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

Similar Threads

  1. Querying Multi Line Text Box in MS Access Forms
    By spindlebeakin10 in forum Queries
    Replies: 5
    Last Post: 12-09-2010, 05:50 PM
  2. Random Text and Numbers
    By Mclaren in forum Programming
    Replies: 5
    Last Post: 11-05-2010, 04:34 AM
  3. Convert text to numbers
    By randolphoralph in forum Access
    Replies: 1
    Last Post: 03-21-2010, 10:33 AM
  4. Converting Option value to text
    By James3mc in forum Forms
    Replies: 4
    Last Post: 11-28-2009, 11:19 PM
  5. Converting all text input to lower case
    By aommaster in forum Forms
    Replies: 6
    Last Post: 08-05-2009, 05:43 AM

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