Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Edmonton, Alberta
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parameter Query (Access 2003)

    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.

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Parameter Query (Access 2003)

    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
    Regards,

    Gary
    (It's been a while!)

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameter Query (Access 2003)

    Example of Query asking for start and end date:

    <pre>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;
    </pre>


    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •