bjfriedman
Technical User
I am trying to create a crosstab query where the Value Field is a sum of all of the transactions in the Payments Table prior to header date for that column. So I am looking for a running total of sorts, to use in an average daily balance calculation
The Header Dates are driven by another table called "Date Range" where I upload the dates of 3 month quarters(if this can be handled differently please let me know). This was the only real way I could create a date range that would reflect the data I needed. Especially because it will need to be changed periodically.
The Column is Driven by APN numbers.
My SQL Looks like:
TRANSFORM DSum([Payments]![Amount],"Payments",[Date Range]![Date Range]=[Payments]![Date]) AS [Running Total]
SELECT Payments.APN
FROM Payments RIGHT JOIN [Date Range] ON Payments.Date = [Date Range].[Date Range]
GROUP BY Payments.APN
ORDER BY Payments.APN, [Date Range].[Date Range]
PIVOT [Date Range].[Date Range];
I am running into the "You are trying to execute a query that does not include the specified expression as a part of the aggreate function"
Any help or direction is greatly appreciated.
-Bryan
The Header Dates are driven by another table called "Date Range" where I upload the dates of 3 month quarters(if this can be handled differently please let me know). This was the only real way I could create a date range that would reflect the data I needed. Especially because it will need to be changed periodically.
The Column is Driven by APN numbers.
My SQL Looks like:
TRANSFORM DSum([Payments]![Amount],"Payments",[Date Range]![Date Range]=[Payments]![Date]) AS [Running Total]
SELECT Payments.APN
FROM Payments RIGHT JOIN [Date Range] ON Payments.Date = [Date Range].[Date Range]
GROUP BY Payments.APN
ORDER BY Payments.APN, [Date Range].[Date Range]
PIVOT [Date Range].[Date Range];
I am running into the "You are trying to execute a query that does not include the specified expression as a part of the aggreate function"
Any help or direction is greatly appreciated.
-Bryan