Results 1 to 2 of 2
  1. #1
    dastr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    8

    MOST COMPLICATED query ever

    Hi all,
    I have the following two tables (you may also refer to attachment)

    Table A
    Person Index Symbol
    Inna - T1 - alpha
    Inna - T4 - beta, theta, delta
    Maria - T1 - delta, theta
    Maria - T4 - alpha, gamma

    And

    Table Conversion
    Symbol Index Combination Symbol value
    Alpha - alphaT1 - 10


    Beta - betaT1 - 18
    Gamma - gammaT1 - 14
    Delta - deltaT1 - 100
    Theta - thetaT1 - 1
    Alpha - alphaT4 - 10
    Beta - betaT4 - 18
    Gamma - gammaT4 - 14
    Delta - deltaT4 - 100
    Theta - thetaT4 - 1

    And the idea is to get:

    Table Outcome
    Person SymbolValues Lowest Value
    Inna - 10- 10
    Inna - 18,100,1 - 1
    Maria - 100,1 - 1
    Maria - 10,14 - 10

    Logic: in table Conversion we look for the symbol value on basis of Index and Symbol from Table A; these values get populated in Symbol value in table Outcome and then we need the Lowest Value of the latter in column Lowest Value Table Outcome.

    Does anyone know how this could be done?
    Thank you VERY VERY much!
    Attached Files Attached Files

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    The first thing that comes to mind,
    Why is symbol stored in Table A, the way it is stored ?
    Table A
    Person Index Symbol
    Inna - T1 - alpha
    Inna - T4 - beta, theta, delta
    Maria - T1 - delta, theta
    Maria - T4 - alpha, gamma
    Why Not

    Table A
    Person Index Symbol
    Inna - T1 - alpha
    Inna - T4 - beta
    Inna - T4 - theta
    Inna - T4 - delta
    Maria - T1 - delta
    Maria - T1 - theta
    Maria - T4 - alpha
    Maria - T4 - gamma


    And

    Is there any particular reason for "Combination Symbol" field ?
    Table Conversion
    Symbol Index Combination Symbol value
    Alpha - alphaT1 - 10
    Beta - betaT1 - 18
    Gamma - gammaT1 - 14
    Delta - deltaT1 - 100
    .....
    Thanks

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

Similar Threads

  1. Replies: 1
    Last Post: 06-25-2012, 07:01 PM
  2. Query with Complicated Requirements
    By Briana in forum Queries
    Replies: 1
    Last Post: 06-13-2012, 08:05 PM
  3. Complicated Query (Interleave rows?)
    By crozfader in forum Queries
    Replies: 8
    Last Post: 09-19-2011, 12:15 PM
  4. Complicated Query needs some date range help
    By KevinMCB in forum Queries
    Replies: 1
    Last Post: 01-11-2011, 12:25 PM
  5. Replies: 1
    Last Post: 12-11-2008, 01:28 PM

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