• Parameter Query (Access 2003)

    Author
    Topic
    #441603

    I have a parameter query so that a user can enter the Start Date and End Date. In the report I would like the report to show the dates the user typed in. Is this possible?
    Thanks in advance.

    Viewing 1 reply thread
    Author
    Replies
    • #1060771

      One way you could do this is to include the parameters as part of the query results that are passed to the report. Then in the report, use two text boxes with a DMax or other function to reference the values you want. (One to get the starting date and one for the ending date.) HTH

    • #1060778

      Example of Query asking for start and end date:

      SELECT tbl_BP_ImrType.strDescription AS Description, 
      Count(tblBPermit.lngBPermitID) AS [Number], 
      Sum(tblBPermit.lngEstCost) AS Cost, Sum(tblBPermit.curTotalFee) AS Fees
      FROM (tblBPermit INNER JOIN tbl_BP_FeeType 
      ON tblBPermit.lngTypeID = tbl_BP_FeeType.lngFeeTypeID) 
      INNER JOIN tbl_BP_ImrType 
      ON tbl_BP_FeeType.lngIMRCodeID = tbl_BP_ImrType.lngImrTypeID
      WHERE ((((tblBPermit.dtmIssueDate)>=[Enter Start Date: Example m/d/y, or OK for All] 
      Or (tblBPermit.dtmIssueDate) Like [Enter Start Date: Example m/d/y, or OK for All] & "*") 
      And ((tblBPermit.dtmIssueDate)<=[Enter End Date: Example m/d/y, or OK for All] 
      Or (tblBPermit.dtmIssueDate) Like [Enter End Date: Example m/d/y, or OK for All] & "*")))
      GROUP BY tbl_BP_ImrType.strDescription, tbl_BP_ImrType.strSeqNo
      ORDER BY tbl_BP_ImrType.strSeqNo, tbl_BP_ImrType.strDescription;
      

      Example of Report Header to display start and end date

      Text Box control on report:
      Control Source: [Enter Start Date: Example m/d/y, or OK for All]

      Text Box control on report:
      Control Source: [Enter End Date: Example m/d/y, or OK for All]

      The above will return start and end date, ex. 1/1/7 1/31/7

      HTH, John

    Viewing 1 reply thread
    Reply To: Parameter Query (Access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: