Calculation Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jalmar
    New Member
    • Feb 2007
    • 21

    #1

    Calculation Query

    TGIF & Good morning:

    Can someone please tell me why my calculation query isn't working. I will post the SQL below for your review. Thanks in advance for your help.

    Code:
    SELECT [Market Value Table 12-05 to 12-06].[Market Value 6/30/06],
           [Fee Table].[Basis Points],
           [MarketValue6/30/06]*[BasisPoints] AS FeeAmount
    FROM [Market Value Table 12-05 to 12-06],
         [Fee Table];
    Last edited by NeoPa; Mar 5 '07, 05:34 PM. Reason: Tags
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Code:
     
    SELECT [Market Value Table 12-05 to 12-06].[Market Value 6/30/06], [Fee Table].[Basis Points], [MarketValue6/30/06]*[BasisPoints] AS FeeAmount
    FROM [Market Value Table 12-05 to 12-06], [Fee Table];
    There is no JOIN between these two tables. What is the relationship between them?

    Mary

    Comment

    • jalmar
      New Member
      • Feb 2007
      • 21

      #3
      Originally posted by mmccarthy
      Code:
       
      SELECT [Market Value Table 12-05 to 12-06].[Market Value 6/30/06], [Fee Table].[Basis Points], [MarketValue6/30/06]*[BasisPoints] AS FeeAmount
      FROM [Market Value Table 12-05 to 12-06], [Fee Table];
      There is no JOIN between these two tables. What is the relationship between them?

      Mary
      OK-I created a relationship between them-the Trust Identifier. now I will try again-let you know. Thanks

      Comment

      • jalmar
        New Member
        • Feb 2007
        • 21

        #4
        Originally posted by jalmar
        OK-I created a relationship between them-the Trust Identifier. now I will try again-let you know. Thanks
        OK-Still not working for me. SQL posted below


        SELECT [Trust Table].[Trust Identifier], [Trust Table].[Trust Account Number], [Trust Table].[Trust Nickname], [Market Value Table 12-05 to 12-06].[Market Value 6/30/06], [Fee Table].[Basis Points], [MarketValue6/30/06]*[BasisPoints]=[SUM] AS [Fee Amount]
        FROM ([Market Value Table 12-05 to 12-06] INNER JOIN [Trust Table] ON [Market Value Table 12-05 to 12-06].[Trust Identifier] = [Trust Table].[Trust Identifier]) INNER JOIN [Fee Table] ON ([Trust Table].[Trust Identifier] = [Fee Table].[Trust Identifier]) AND ([Market Value Table 12-05 to 12-06].[Trust Identifier] = [Fee Table].[Trust Identifier])
        WHERE ((([Trust Table].Relationship)= "M Family"));

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Try this ...

          Code:
          SELECT [Trust Table].[Trust Identifier], 
          [Trust Table].[Trust Account Number], 
          [Trust Table].[Trust Nickname], 
          [Market Value Table 12-05 to 12-06].[Market Value 6/30/06], 
          [Fee Table].[Basis Points], 
          [MarketValue6/30/06]*[BasisPoints] AS [Fee Amount]
          FROM ([Market Value Table 12-05 to 12-06] INNER JOIN [Trust Table] 
          ON [Market Value Table 12-05 to 12-06].[Trust Identifier] = [Trust Table].[Trust Identifier]) 
          INNER JOIN [Fee Table] 
          ON ([Trust Table].[Trust Identifier] = [Fee Table].[Trust Identifier]) 
          WHERE ((([Trust Table].Relationship)="M Family"));
          Mary

          Comment

          • jalmar
            New Member
            • Feb 2007
            • 21

            #6
            Originally posted by mmccarthy
            Try this ...

            Code:
            SELECT [Trust Table].[Trust Identifier], 
            [Trust Table].[Trust Account Number], 
            [Trust Table].[Trust Nickname], 
            [Market Value Table 12-05 to 12-06].[Market Value 6/30/06], 
            [Fee Table].[Basis Points], 
            [MarketValue6/30/06]*[BasisPoints] AS [Fee Amount]
            FROM ([Market Value Table 12-05 to 12-06] INNER JOIN [Trust Table] 
            ON [Market Value Table 12-05 to 12-06].[Trust Identifier] = [Trust Table].[Trust Identifier]) 
            INNER JOIN [Fee Table] 
            ON ([Trust Table].[Trust Identifier] = [Fee Table].[Trust Identifier]) 
            WHERE ((([Trust Table].Relationship)="M Family"));
            Mary
            Hi Mary and thanks for your help but that code still didn't input any data into the Fee amount fields. It isn't generating anything for me. Thanks for helping me with this.

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by jalmar
              Hi Mary and thanks for your help but that code still didn't input any data into the Fee amount fields. It isn't generating anything for me. Thanks for helping me with this.
              What is being stored in [MarketValue6/30/06] and in [BasisPoints] and what is the datatype of both these fields?

              Comment

              • jalmar
                New Member
                • Feb 2007
                • 21

                #8
                Originally posted by mmccarthy
                What is being stored in [MarketValue6/30/06] and in [BasisPoints] and what is the datatype of both these fields?
                OK-I figured it out-my equation wasn't right-I still needed to divide some numbers. Thanks for your help. Have a great weekend.

                Comment

                • MMcCarthy
                  Recognized Expert MVP
                  • Aug 2006
                  • 14387

                  #9
                  Originally posted by jalmar
                  OK-I figured it out-my equation wasn't right-I still needed to divide some numbers. Thanks for your help. Have a great weekend.
                  No problem, you too.

                  Mary

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32669

                    #10
                    Well, I'm glad you got that one sorted out Mary ;)

                    Comment

                    Working...