Please HELP - build query to get the right report results !

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I need some hel

SELECT count(*) AS ReceiptMethodCount, [Receipt Method] FROM Correspondence WHERE [Correspondence Date]>=[Forms]![Reports Form]![DateFirst] And [Correspondence Date]<=[Forms]![Reports Form]![DateLast] GROUP BY [Receipt Method]
 
And your question or problem is????

The query doesn't work?
The query returns the wrong results?
The query errors?

The report errors?
The report presents the data in the wrong order?
You want to show other data?

You get prompted for input?

I'll GUESS that you haven't defined the parameters in the query and it is saying
that it doesn't know what [Forms]![Reports Form]![DateFirst] is or perhaps it is
misinterpreting the input as a division 12 / 1 / 2004 (which yield a datetime
value on December 30, 1899).

So try the following

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
Repeat for the second parameter


You should end up with something like
PARAMETERS [Forms]![Reports Form]![DateFirst] DateTime,
[Forms]![Reports Form]![DateLast] DateTime;
SELECT Count(*) AS ReceiptMethodCount,
[Receipt Method]
FROM Correspondence
WHERE [Correspondence Date]>=[Forms]![Reports Form]![DateFirst]
And [Correspondence Date]<=[Forms]![Reports Form]![DateLast]
GROUP BY [Receipt Method]
 
Back
Top