Results 1 to 2 of 2
  1. #1
    calcala is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    1

    Newbie with questions on conditional statements and multiple joins

    Hi,

    I am new to using SQL/Access. I am trying to build a query that produces a "bill of materials" for a store remodel. The content of the bill of materials should change based on the type of the store or the type of item (either I need to add items or add additional detail or spec to an item).

    For instance, If one of the items listed is an open refrigerator and the refrigerator goes into a store that is not open 24 hours, I should pull the additional spec from the specs table (the additional spec says something like "night curtains required".

    So the following query is giving me a syntax error (as soon as I remove the 24hr condition the error goes away but the query brings the "night curtains required" for all the stores, which is not the point).

    Code:
    SELECT Quantities.Store_no, Quantities.Section, Quantities.ItemID, Quantities.Quantity, specs.detail
    FROM (storeItemsquantities AS quantities LEFT OUTER JOIN basic_rules_specs AS specs ON quantities.itemID=specs.itemID) INNER JOIN concept_matrix AS cmatrix ON quantities.store_no = cmatrix.store_no and cmatrix.24hrs=’N’;




    FYI: concept_matrix is the table that contains store information. Quantities is the table that contains the "rough" bill of materials.

    I have also tried to do the left outer join with the cmatrix table but I get the same result.

    Can anyone help me, please? I running out of ideas. If there is a better way to build the query please let me know as well, since I am new to Access and SQL.

    https://rapidshare.com/files/3753977...M_database.zip



    The link contains a dummied down version of the DB I am working on, but hopefully illustrates what I am trying to do.

    Thank you!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't know how this post got attached to this thread, comments were for another thread. I think moderator edit got mixed up.
    Last edited by June7; 11-15-2011 at 01:49 AM.
    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. Newbie w/a few questions
    By Davo in forum Access
    Replies: 3
    Last Post: 11-14-2011, 01:13 PM
  2. Replies: 1
    Last Post: 03-25-2011, 12:31 PM
  3. Couple of newbie questions
    By Awowk in forum Access
    Replies: 12
    Last Post: 08-06-2010, 01:16 PM
  4. Basic questions from a newbie! :(
    By Michael_ in forum Access
    Replies: 6
    Last Post: 05-07-2010, 02:41 PM
  5. newbie questions
    By bigmac in forum Access
    Replies: 0
    Last Post: 10-07-2008, 12:53 AM

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