Hello all --
I have a report which shows data aggregated at an account level, where any one account might have one or many units that belong to it.
This report shows a "Date Received" for surveys that we receive from the field. I group by this field in order to get one nice dataset in order to display.
The problem is that some accounts (nay, most accounts) are sending in different units' surveys on different dates, and so now because of my GROUP BY clause, my account level report is quickly turning into a unit level report -- i.e. the units are falling out onto different rows of data due to the difference in the "dateReceived" column.
My question is: Is there some way that I can make the SELECT statement simply group by the latest dateReceived?
If I were going to program this, I would do a lookup on every row of account data and extract the latest dateReceived, but this would be horribly innefficient, and so I'd really like to have a single SQL Statement that would take care of it for me.
If anyone could confirm or deny the existence of such a statement for me, I would (as always) greatly appreciate it.
Thanks!
Paul Prewett
I have a report which shows data aggregated at an account level, where any one account might have one or many units that belong to it.
This report shows a "Date Received" for surveys that we receive from the field. I group by this field in order to get one nice dataset in order to display.
The problem is that some accounts (nay, most accounts) are sending in different units' surveys on different dates, and so now because of my GROUP BY clause, my account level report is quickly turning into a unit level report -- i.e. the units are falling out onto different rows of data due to the difference in the "dateReceived" column.
My question is: Is there some way that I can make the SELECT statement simply group by the latest dateReceived?
If I were going to program this, I would do a lookup on every row of account data and extract the latest dateReceived, but this would be horribly innefficient, and so I'd really like to have a single SQL Statement that would take care of it for me.
If anyone could confirm or deny the existence of such a statement for me, I would (as always) greatly appreciate it.
Thanks!

Paul Prewett

