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

    SQL Wildcards

    I use Abbriviates to insert flower colours into a column (Fcolor) of my database. Like this;

    Red (A)
    Orange (B)
    Yellow (C)
    Green (E)
    Blue (G)
    Violet (H)
    Pink (I)
    White (J)
    Creamy (K)
    Black (L)
    Gray (M)
    Brown (N)

    When 1 flower has more than 1 color, I add them as combinations like;

    AB, CG, ABC



    My database's flowercolor table looks like this;

    ID Fcolor
    1 AC
    2 BC
    3 K
    4 IJA
    I need to ritrive an output like this; (ID's of flowers contain Red colour)

    Red colour Flower ID's
    1
    4

    Red is indicated by "A". It doesnt really matter there r some other colors in that cell. ex: ID 1 flower have Red and yellow. But it doesnt matter I need to get flowers that contain redcolour. This can be done using Wild cards.

    or is there a better method to add colors to a database? pls help

  2. #2
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    Do you have that database created? If it is actually functioning properly, you can create a simple query to get only the flowers with a RED colour:

    SELECT a.*
    FROM TableName AS a
    WHERE Fcolor = '*A*';

    Change the 'TableName' to your table name obviously.

    I guess you want to know wildcards because you havent created the database?
    If there are only a handfull of colours it's almost best to do it via excel or by 'hand'. I guess since you are using the alphabet that there cannot be hundreds.

  3. #3
    sandlucky is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    35
    Thaxalot!

    My Database is already created and working properly 4 other queries.

    I only use these abbriviates,

    Red (A)
    Orange (B)
    Yellow (C)
    Green (E)
    Blue (G)
    Violet (H)
    Pink (I)
    White (J)
    Creamy (K)
    Black (L)
    Gray (M)
    Brown (N)

    Red (A)
    Orange (B)
    Yellow (C)
    Green (E)
    Blue (G)
    Violet (H)
    Pink (I)
    White (J)
    Creamy (K)
    Black (L)
    Gray (M)
    Brown (N)

    is this method effective?

  4. #4
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    You are welcome,

    Yes it is effective until you get so many shades/colours that you get to the end of the alphabet.

    If you are confident that you won't get to that point then i wouldnt worry about it, however if you will, change that system to an Alphanumeric key instead.

  5. #5
    sandlucky is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2011
    Posts
    35
    Thanxalot,
    I hav only 10-15 values. Alphabet is enough.
    Thanx!

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

Similar Threads

  1. Using wildcards with between workaround
    By rushforth in forum Queries
    Replies: 2
    Last Post: 11-10-2010, 02:12 PM
  2. Using wildcards (*) in SQL
    By SIGMA248 in forum Queries
    Replies: 1
    Last Post: 07-22-2010, 08:44 PM
  3. Wildcards?!
    By esx_raptor in forum Access
    Replies: 3
    Last Post: 02-19-2010, 03:22 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