How to display most recent Activity type on report
I have a combined report that shows the most recent time an account was contacted within the last 30 days and the activity type. The last completed activity date displays correctly using the MAX funtion, but the type is not pulling the type that corresponds with the date. It is showing a type when applicable, but it is the first one in the list. I want the report to show the type only if it was completed within the last 30 days.
Here is my formula:
CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY,MAX(CAST(Activity."Completed Date" AS DATE)),CURRENT_DATE)< 30 THEN Activity."Type" ELSE NULL END
0