I'm writting an aging reprt within SSRS and I've managed to get it working as long as I use set day amounts within my query, ideally I'd like to be able to let the user specify the days they would like the transactions aged by.
So at the moment they're 30,60,90 but I'd like to create parameters so that the user can age the data by whichever amount of days they want, I'm using an ODBC connection to a Progress DB if that makes any difference and the aging part of my SELECT statement is below.
CASE WHEN TIMESTAMPDIFF(sql_tsi_day, AROpenTran.TransactionDate, Now()) BETWEEN 30 AND 60 THEN AROpenTran.Base1Amount ELSE 0 END AS balance_1_30 , CASE WHEN TIMESTAMPDIFF(sql_tsi_day, AROpenTran.TransactionDate, Now()) BETWEEN 60 AND 90 THEN AROpenTran.Base1Amount ELSE 0 END AS balance_30_60 , CASE WHEN TIMESTAMPDIFF(sql_tsi_day, AROpenTran.TransactionDate, Now()) BETWEEN 90 AND 120 THEN AROpenTran.Base1Amount ELSE 0 END AS balance_60_90 , CASE WHEN TIMESTAMPDIFF(sql_tsi_day, AROpenTran.TransactionDate, Now()) > 120 THEN AROpenTran.Base1Amount ELSE 0 END AS balance_90
Any help would be appreciated