D
Darryl
Hi all, I've written a query that calculates the cumulative sum of a column.
I've used the DSum function as I need to use this query for updates. It
works, but it's way too slow as I have >60,000 rows to process (Background:
This was originally done in Excel, but I need to do it in Access now because
of Excel's 65K row limit). Does anyone know how I might be able to optimize
this? I've heard that using in-line functions is the fastest, but I'm not
sure how to even go about doing this. Will someone be able to help?
The query I've written is as follows:
SELECT t1.ID, t1.Customer, t1.Customer_Lifetime_Value,
DSum("Customer_Lifetime_Value","06_Lifetime_Value_Tier","[ID] <= " & [ID]) AS
Cumulative_Lifetime_Value
FROM 06_Lifetime_Value_Tier AS t1
ORDER BY t1.Customer_Lifetime_Value DESC;
I've already indexed the ID column, but the update statement that uses this
query still takes > 1 hour to process! Please help!
I've used the DSum function as I need to use this query for updates. It
works, but it's way too slow as I have >60,000 rows to process (Background:
This was originally done in Excel, but I need to do it in Access now because
of Excel's 65K row limit). Does anyone know how I might be able to optimize
this? I've heard that using in-line functions is the fastest, but I'm not
sure how to even go about doing this. Will someone be able to help?
The query I've written is as follows:
SELECT t1.ID, t1.Customer, t1.Customer_Lifetime_Value,
DSum("Customer_Lifetime_Value","06_Lifetime_Value_Tier","[ID] <= " & [ID]) AS
Cumulative_Lifetime_Value
FROM 06_Lifetime_Value_Tier AS t1
ORDER BY t1.Customer_Lifetime_Value DESC;
I've already indexed the ID column, but the update statement that uses this
query still takes > 1 hour to process! Please help!