Re: Parameter query
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 14:41:00 +0900
A subreport can be called many times (e.g. for each record in the main report), and will ask for its parameter each time.
To avoid that, create a form with text boxes where the user can enter the limiting dates before opening the report. The query can then read the dates from the form as often as it gets called.
This kind of thing:
PARAMETERS [Forms].[Form1].[txtStart] DateTime,
[Forms].[Form1].[txtEnd] DateTime;
SELECT ...
HAVING [Investment Details].DateTransaction
Between [Forms].[Form1].[txtStart]
And [Forms].[Form1].[txtEnd] - 1
ORDER BY ...
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"DJTI via AccessMonster.com" <u30755@uwe> wrote in message
news:6e1941f03ae6a@xxxxxx
I hope someone can help me with this.
I have a Parameter query that is a subquery for 2 queries for 2 reports.
These reports are run the same time. The problem is the Parameter prompts
before the second report opens for preview. How do I get the parameter prompt
to run only once for the 'subquery' and continue through until the 2 reports
are closed.
The criteria for the parameters to get [LastTransDate] are:
Between [Enter Last Confirm Date] And ([Enter Most Recent Confirm Date]-1)
SQL for subquery:
PARAMETERS [Enter Last Confirm Date] DateTime, [Enter Most Recent Confirm
Date] DateTime;
SELECT [Investment Details].InvestmentID, [Investment Details].
DateTransaction AS LastTransDate, [CumuShares]+nz([CumuShares]*[QDivValue])-
nz([CumuShares]*[RedeembyShare])*[CurShareValue] AS LastTotalShares
FROM Investment LEFT JOIN [Investment Details] ON Investment.InvestmentID =
[Investment Details].InvestmentID
GROUP BY [Investment Details].InvestmentID, [Investment Details].
DateTransaction, [CumuShares]+nz([CumuShares]*[QDivValue])-nz([CumuShares]*
[RedeembyShare])*[CurShareValue], Investment.CumuShares, [Investment Details].
QDivValue, [Investment Details].QCashPdValue, [Investment Details].
CurShareValue, [Investment Details].RedeembyShare
HAVING ((([Investment Details].DateTransaction) Between [Enter Last Confirm
Date] And ([Enter Most Recent Confirm Date]-1)))
ORDER BY [Investment Details].DateTransaction DESC;
Thanks,
Deb
.
- Follow-Ups:
- Re: Parameter query
- From: DJTI via AccessMonster.com
- Re: Parameter query
- References:
- Parameter query
- From: DJTI via AccessMonster.com
- Parameter query
- Prev by Date: Re: Report Parameters - no results
- Next by Date: Re: Grouping by first two digits of a project number
- Previous by thread: Parameter query
- Next by thread: Re: Parameter query
- Index(es):
Relevant Pages
|