Hello.
I have a query where the intent is to return the most recent Statement Closing Date by Account Identifier.
This works great
SELECT [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number], Max([ME - Balances and Activity at Cycle End_Updated].[Statement Closing Date]) AS [MaxOfStatement Closing Date]
FROM [ME - Balances and Activity at Cycle End_Updated]
GROUP BY [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number];
However, when I introduce variable data, such as a balance field where the balance is different every Statement Closing Date, I get everything.
My question is how do I get my query to return just the most recent Statement Closing Date, regardless of the variable data?
Thank you.
I have a query where the intent is to return the most recent Statement Closing Date by Account Identifier.
This works great
SELECT [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number], Max([ME - Balances and Activity at Cycle End_Updated].[Statement Closing Date]) AS [MaxOfStatement Closing Date]
FROM [ME - Balances and Activity at Cycle End_Updated]
GROUP BY [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number];
However, when I introduce variable data, such as a balance field where the balance is different every Statement Closing Date, I get everything.
My question is how do I get my query to return just the most recent Statement Closing Date, regardless of the variable data?
Thank you.