Results 1 to 3 of 3
  1. #1
    sandlucky is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    35

    Lightbulb Switch function query to combine tables

    I have 2 tables in my database (Main, Decode)
    In decode table there are 2 col's 1 contain Abbriviate (code) and other contains Orginal text.

    Code Orginal
    A Tree
    B Shrub
    C Herb
    D Climber
    E Ground cover

    Main table is the table I add data in Abbriviated (short form) format.
    basically it is like this (over 30 columns> ID species Genus Habitate Ecosystem Flowercolor)

    ID Habitat
    01 B
    02 C
    03 A
    04 E
    05 A
    06 A
    07 E

    I try to use below query to retrive orginal (Tree, Shrub,...) words insted of Abbriviates (A, B, C, ) As a column called "List" (As List)

    SELECT Sinhala1 AS Sinhala, English1 AS English, Switch(Main.Habitat='Decode.code','Decode.Orginal' ) AS List


    FROM Main
    WHERE Main.Habitat = Decode.Code

    It's not working , Pls help

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sandlucky is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    35
    Problem solved , Thanx!

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

Similar Threads

  1. Using SQL switch function MS Access
    By sandlucky in forum Queries
    Replies: 18
    Last Post: 03-31-2011, 08:49 AM
  2. Combine switch function and Wild cards together
    By sandlucky in forum Queries
    Replies: 0
    Last Post: 03-28-2011, 11:51 PM
  3. I have 4 Tables in Access - can I combine them?
    By officespace in forum Access
    Replies: 6
    Last Post: 02-22-2009, 07:21 AM
  4. combine three tables in a query
    By neuenglander in forum Queries
    Replies: 0
    Last Post: 08-21-2008, 04:02 AM
  5. Switch and Tables
    By UtilityRyan in forum Database Design
    Replies: 0
    Last Post: 06-12-2007, 03:49 PM

Tags for this Thread

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