I forgot to include the database. However, I am having trouble attaching it.
I can send it to your email address if you want.
I forgot to include the database. However, I am having trouble attaching it.
I can send it to your email address if you want.
And again you haven't used parameters in your query example at all! Logically you must have someting like;
PARAMETERS [Start Date] DateTime, [End Date] DateTime;
SELECT DISTINCT [Individual Donor Table].[Full Name], Sum([Individual Gift Amount Table].[Gift Amount]) AS [SumOfGift Amount]
FROM [Individual Donor Table] INNER JOIN [Individual Gift Amount Table] ON [Individual Donor Table].[Full Name]=[Individual Gift Amount Table].[Full Name]
WHERE [Individual Gift Amount Table].[SomeDateField] > [Start Date] AND [Individual Gift Amount Table].[SomeDateField] < [End Date]
GROUP BY [Individual Donor Table].[Full Name]
UNION SELECT DISTINCT [Organization Donor Table].[Org Name], Sum([Organization Gift Amount Table].[Gift Amount]) AS [SumOfGift Amount]
FROM [Organization Donor Table] INNER JOIN [Organization Gift Amount Table] ON [Organization Donor Table].[Org Name] = [Organization Gift Amount Table].[Organ Name]
WHERE [Organization Donor Table].[SomeDateField] > [Start Date] AND [Organization Donor Table].[SomeDateField] < [End Date]
GROUP BY [Organization Donor Table].[Org Name];
9/6/17Here is the query:
PARAMETERS [Start Date] DateTime, [End Date] DateTime;
SELECT DISTINCT [Individual Donor Table].[Full Name], Sum([Individual Gift Amount Table].[Gift Amount]) AS [SumOfGift Amount]
FROM [Individual Donor Table] INNER JOIN [Individual Gift Amount Table] ON [Individual Donor Table].[Full Name]=[Individual Gift Amount Table].[Full Name]
GROUP BY [Individual Donor Table].[Full Name]
UNION SELECT DISTINCT [Organization Donor Table].[Org Name], Sum([Organization Gift Amount Table].[Gift Amount]) AS [SumOfGift Amount]
FROM [Organization Donor Table] INNER JOIN [Organization Gift Amount Table] ON [Organization Donor Table].[Org Name] = [Organization Gift Amount Table].[Organ Name]
GROUP BY [Organization Donor Table].[Org Name];
The problem appears to have gone away. I added the following line to it:
ORDER BY [SumOfGift Amount] DESC;
Not sure if this is what made it work.
Again, unless at least one of [Individual Donor Table] or [Individual Gift Amount Table] or [Organization Donor Table] or [Organization Gift Amount Table] are in fact a query and not a table then you are not even using the parameters.
To use parameters to filter by date would be something like this:
The first "PARAMTERS" line just tells access that you intend on using the variables listed, but for them to actually have any effect on the query they need to be included somewhere in the sql statement below that line. If they are not included below, then you might as well just delete the first PARAMETERS line all together.Code:PARAMETERS StartDate DateTime, EndDate DateTime; SELECT * FROM MyTable WHERE MyTable.SomeDateField Between StartDate and EndDate