Results 1 to 5 of 5
  1. #1
    H.S.SHASTRI is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2018
    Posts
    1

    conditional query


    Hi,
    I am new to access. Presently I am working on a small data base. My Table contains following fields.
    Part Number , Estimated Cost ,Supplier , Supplier Quote,Settled Quote.
    Part No Estimated Cost Supplier Supplier Quote Settled Quote
    1000 10 A 12 9
    1000 10 A 13 9
    1001 50 D
    1002 20 B 24 15
    1002 20 C 22 15
    1002 20 A 22 15

    What I am looking for is to calculate B.O.M cost with logic , consider cost if settled then settled else min of supplier quote else estimated in case no supplier has yet quoted.

    Regards
    H S Shastri

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    What I am looking for is to calculate B.O.M cost with logic , consider cost if settled then settled else min of supplier quote else estimated in case no supplier has yet quoted.
    I have absolutely no idea what that means or how it relates to the data you provided.
    Others may understand but B.O.M. doesn't mean anything to me either

    Wikipedia gave me the following:
    None of those look relevant to me
    If you want someone to give an informed answer, I suggest you explain in a different way

    It might help if you state the expected results for that data
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    Bill Of Materials, but not clear what is meant by settled cost, don't see why a supplier would quote a price then settle for a lower price.

    However I agree, not clear what is being asked in terms of the calculation. How do you determine if settled? a value in the settled field?

    what would your calculation show for the example data you provided?

    Also concerned the table design does not look normalised, even with such few fields.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Welcome to the forum.

    I agree with the other responders --your issue isn't clear.
    It is often a good strategy to describe your "requirement" in simple, plain English. Don't show readers you table or fields (or worse yet a "concept" sample with made up data).

    A "wild" guess at your question and preamble(based on BOM as Bill of Materials) is:

    I have a small business where we assemble/build products. A Product may consist of many parts.
    I purchase Parts from Suppliers. Multiple Suppliers may offer the same Parts. I request Estimated Costs for such Parts from different Suppliers, and often purchase based on lowest cost.
    Also, for each Product I maintain a Parts hierarchy. I would like to automate how to determine a Product cost based on the Parts hierarchy and settled Quote costs. My question relates to the design of the hierarchy and method to traverse the Parts to calculate costs. I would appreciate any info.


    Here is info on a hierarchy that may be helpful.

    Good luck with your project.

    You might also try Google search for relational database hierarchical data structure

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    So not only do you need to compare data within a record, need to compare data with other records for same part.

    SELECT PartNo, MIN(Nz(SettledQuote, Nz(SupplierQuote, Nz(Estimated, 0))) AS Cost FROM tablename GROUP BY PartNo;

    However, that will not get you the Supplier and if you need that it gets a little complicated.


    Advise not to use spaces nor punctuation/special characters (underscore only exception) in naming convention.
    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. Use of IIf conditional query
    By access_sql_guy in forum Access
    Replies: 3
    Last Post: 02-19-2016, 06:43 PM
  2. Conditional Query?
    By jeffoest in forum Access
    Replies: 9
    Last Post: 02-19-2016, 12:31 PM
  3. Conditional Query with conditional results
    By Jeff_in_KCMO in forum Queries
    Replies: 4
    Last Post: 09-10-2014, 01:44 PM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. Conditional Query
    By thegladiator in forum Queries
    Replies: 1
    Last Post: 01-14-2011, 11:44 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