locked
show days since last activity RRS feed

  • Question

  • I need to create code (in reporting services) that will show amount of days since last activity was created (from current date) for a specific record (excludes phone/email...all other activities).

    Any ideas?

    Thank you


    Apps
    Tuesday, January 4, 2011 12:59 PM

Answers

  • Hello, Bernardina.

     

    Following query gives you the result for accounts:

    Select
    	account.name
    	,DATEDIFF(day, Max(activity.actualend), GetDate())
    From FilteredAccount account
    	Left Join FilteredActivityParty actparty on account.accountid = actparty.partyid
    	Left Join FilteredActivityPointer activity on actparty.activityid = activity.activityid
    Group By account.name, account.accountid
    
    
    You can change it for any record you want.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Tuesday, January 4, 2011 2:35 PM
    Moderator

All replies

  • Hello, Bernardina.

     

    Following query gives you the result for accounts:

    Select
    	account.name
    	,DATEDIFF(day, Max(activity.actualend), GetDate())
    From FilteredAccount account
    	Left Join FilteredActivityParty actparty on account.accountid = actparty.partyid
    	Left Join FilteredActivityPointer activity on actparty.activityid = activity.activityid
    Group By account.name, account.accountid
    
    
    You can change it for any record you want.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Tuesday, January 4, 2011 2:35 PM
    Moderator
  • Thank you. I will try it.
    Apps
    Tuesday, January 4, 2011 2:37 PM