I have 2 queries. The first query gives a square root calculation number and the second query gives a running sum of that number. I'm wondering if the two queries below could be combined into one. Thanks to anyone who can help!!!
Query1
SELECT [Begin] & " To " & [End] AS Range, Count(tblAmount.ID) AS Records, Sum(tblAmount.Amt) AS Dollars, tblStrataRange.Diff, Sqr([Diff]*[Records]) AS Expr1, tblStrataRange.ID
FROM tblAmount, tblStrataRange
WHERE (((Abs([Amt])) Between [Begin] And [End]))
GROUP BY [Begin] & " To " & [End], tblStrataRange.Diff, tblStrataRange.ID, tblStrataRange.Begin
ORDER BY tblStrataRange.Begin;
Query2
SELECT A.Records, A.Range, Sum(B.Expr1)
FROM sqryRangeCount AS A INNER JOIN sqryRangeCount AS B ON A.ID>=B.ID
GROUP BY A.Range, A.ID, A.Records, A.Expr1
ORDER BY A.ID;
Query1
SELECT [Begin] & " To " & [End] AS Range, Count(tblAmount.ID) AS Records, Sum(tblAmount.Amt) AS Dollars, tblStrataRange.Diff, Sqr([Diff]*[Records]) AS Expr1, tblStrataRange.ID
FROM tblAmount, tblStrataRange
WHERE (((Abs([Amt])) Between [Begin] And [End]))
GROUP BY [Begin] & " To " & [End], tblStrataRange.Diff, tblStrataRange.ID, tblStrataRange.Begin
ORDER BY tblStrataRange.Begin;
Query2
SELECT A.Records, A.Range, Sum(B.Expr1)
FROM sqryRangeCount AS A INNER JOIN sqryRangeCount AS B ON A.ID>=B.ID
GROUP BY A.Range, A.ID, A.Records, A.Expr1
ORDER BY A.ID;