Results 1 to 4 of 4
  1. #1
    calobo is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    4

    Change information in a query

    Hello,

    I have a query whith a column "Zone codes" which is populated with numbers. In this query, on an other column I put a sql code so that only the first digit of the numbers in the column "Zone codes" would appear. This column, named "binary", only has numbers 0 and 1.
    What I need now is to populate an other column "UTM code" in this query with values BB or CB based on whether the column "binary" has 0 or 1. As the column "binary", this column "UTM code" is not linked to any table. It is just a column in the query.

    Can anyone please tell me how to do this?

    Thank you in advance



    Best wishes

    Carlos

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Am I missing something :

    Code:
    SELECT 
    	myTable.ZoneCode, 
    	Left([ZoneCode],1) AS [Binary], 
    	IIf([Binary]=0,"BB","CB") AS UTM
    FROM 
    	myTable;
    Thanks

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    ignore this response. I posted in error.

  4. #4
    calobo is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    4
    Worked just fine.

    Thank you very much

    Carlos

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

Similar Threads

  1. Query additional information - Sub Query?
    By mohiahmed in forum Queries
    Replies: 7
    Last Post: 02-15-2012, 12:22 PM
  2. Replies: 1
    Last Post: 01-20-2012, 04:31 PM
  3. Display Query Information on a form
    By srmezick in forum Forms
    Replies: 2
    Last Post: 12-15-2011, 09:24 AM
  4. Open form based on query information
    By MFS in forum Programming
    Replies: 3
    Last Post: 06-11-2011, 12:44 PM
  5. Replies: 1
    Last Post: 07-06-2007, 08:27 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