Run Report asks for Parameters it already has?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcupito
    Contributor
    • Aug 2013
    • 294

    Run Report asks for Parameters it already has?

    I'm creating a report that creates a value from AwardedUnits * NetAssetValue, and creates a check using that value (it does a couple other irrelevant things, also.)

    I take the Sum() of the awards, and here is the SQL:
    Code:
    SELECT BenePayoutTbl1.BeneID, 
    BenePayoutTbl1.BeneFirst, 
    BenePayoutTbl1.BeneLast,
     BenePayoutTbl1.PrimaryBene,
     Sum(BenePayoutTbl1.UnitsRemaining) AS SumOfUnitsRemaining,
     AstBeneficiaryTbl.BenStreet,
     AstBeneficiaryTbl.BenCity, 
    AstBeneficiaryTbl.BenState, 
    AstBeneficiaryTbl.BenZip,
     [FederalTax] AS Expr1,
     [StateTax] AS Expr2, 
    BenePayoutTbl1.NAV_Dt,
     NAV_Tbl.NetAssetValue
    FROM NAV_Tbl
     INNER JOIN (AstBeneficiaryTbl
     INNER JOIN BenePayoutTbl1 
    ON AstBeneficiaryTbl.BeneficiaryID = BenePayoutTbl1.BeneID)
     ON NAV_Tbl.NAV_Date = BenePayoutTbl1.NAV_Dt
    GROUP BY BenePayoutTbl1.BeneID,
     BenePayoutTbl1.BeneFirst, 
    BenePayoutTbl1.BeneLast, 
    BenePayoutTbl1.PrimaryBene, 
    AstBeneficiaryTbl.BenStreet,
     AstBeneficiaryTbl.BenCity, 
    AstBeneficiaryTbl.BenState,
     AstBeneficiaryTbl.BenZip, 
    [FederalTax], [StateTax], 
    BenePayoutTbl1.NAV_Dt,
     NAV_Tbl.NetAssetValue;
    The query gives me 107 = [SumOfRemainingU nits], however, when I run the report it asks me for [SumOfRemainingU nits].

    Anyone have any ideas?
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1290

    #2
    Look at the query behind the report. Is the name of the column [SumOfRemainingU nits]? Either the query, or some object in the report is looking for that field and it does not exist with that name. Perhaps it is renamed in the report recordset.

    Jim

    Comment

    • mcupito
      Contributor
      • Aug 2013
      • 294

      #3
      Yes, it's just a Sum of a field. I checked the spelling and everything seems to be fine.

      It was actually [SumOfUnitsRemai ning].

      Here is the SQL:
      Code:
      SELECT 
          BenePayoutTbl1.BeneID, 
          BenePayoutTbl1.BeneFirst,
          BenePayoutTbl1.BeneLast, 
          BenePayoutTbl1.PrimaryBene, 
          Sum(BenePayoutTbl1.UnitsRemaining) AS SumOfUnitsRemaining,
          AstBeneficiaryTbl.BenStreet, 
          AstBeneficiaryTbl.BenCity, 
          AstBeneficiaryTbl.BenState, 
          AstBeneficiaryTbl.BenZip, 
          [FederalTax] AS Expr1, 
          [StateTax] AS Expr2, 
          BenePayoutTbl1.NAV_Dt, NAV_Tbl.NetAssetValue
       FROM NAV_Tbl
       INNER JOIN (AstBeneficiaryTbl 
      INNER JOIN BenePayoutTbl1 
          ON AstBeneficiaryTbl.BeneficiaryID = BenePayoutTbl1.BeneID) 
             ON NAV_Tbl.NAV_Date = BenePayoutTbl1.NAV_Dt
      GROUP BY BenePayoutTbl1.BeneID, BenePayoutTbl1.BeneFirst, 
      BenePayoutTbl1.BeneLast, BenePayoutTbl1.PrimaryBene, 
      AstBeneficiaryTbl.BenStreet, AstBeneficiaryTbl.BenCity, 
      AstBeneficiaryTbl.BenState, AstBeneficiaryTbl.BenZip,
       [FederalTax], [StateTax], BenePayoutTbl1.NAV_Dt, NAV_Tbl.NetAssetValue;

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Yes, it's just a Sum of a field. I checked the spelling and everything seems to be fine
        Are you still haveing the issue, or did you find the typo?

        Comment

        • mcupito
          Contributor
          • Aug 2013
          • 294

          #5
          Hey, zmbd, thanks for the reply.

          I am only having the issue when the report using the underlying query (the SQL I posted) is being ran. If I ran the query from the Object list it runs fine and only asks me for [FederalTax] and [StateTax].

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            Double check line 5 in op the "as" name
            It does not match the name you subsequently gave for the prompt.

            As jimatqsi has pointed out, something on the report-form is asking for this name and it does not match anything within the underlying recordset; thus, the prompt.

            Comment

            • mcupito
              Contributor
              • Aug 2013
              • 294

              #7
              Okay - I found the fields on the report. If I delete them, the subreports return no data, but if I press "OK" when the parameter box pops up, the data loads fine. Any idea on how to squelch it?

              Comment

              • zmbd
                Recognized Expert Moderator Expert
                • Mar 2012
                • 5501

                #8
                Check the properties of the fields.... there's something not set correctly with them and it has to do with the names for the parameters you are being prompted for....

                Comment

                • mcupito
                  Contributor
                  • Aug 2013
                  • 294

                  #9
                  The only thing I am seeing is ORDER BY NAV_Date DESC

                  Comment

                  • mcupito
                    Contributor
                    • Aug 2013
                    • 294

                    #10
                    Doh, deleting the Order By worked... -_-

                    Comment

                    • zmbd
                      Recognized Expert Moderator Expert
                      • Mar 2012
                      • 5501

                      #11
                      It is the little things that will cause the most damage.
                      That'll be 100KG of Richart or Callebaut Chocolate
                      (^_^)
                      Last edited by zmbd; Feb 24 '14, 11:02 PM.

                      Comment

                      • mcupito
                        Contributor
                        • Aug 2013
                        • 294

                        #12
                        Haha would you like that served with a warm glass of milk?

                        Comment

                        • zmbd
                          Recognized Expert Moderator Expert
                          • Mar 2012
                          • 5501

                          #13
                          hmmm... no, they both make Excellent truffles and other wonderful confectionary items... which I am fairly good at making )slobber...and. ..smakcckingofl ipsoundsintheba ckground(

                          (O_O)

                          Comment

                          Working...