Opportunity Close Date Approaching

This question is not answered

I would like to clone and then modify the exisiting rule, to have an additional reminder sent out, perhaps when the open opportunity is 35-45 days old.

This is the original SQL Trigger Clause.

"oppo_assigneduserid=#U and datediff(d,getdate(),oppo_targetclose) in (0,1,2,3,4,5) and oppo_status = 'In Progress' and oppo_reminder = 'N' and ((Escl_EscalationId is NULL ) OR (Escl_WorkflowRuleId <> 10164 ) OR ((Escl_WorkFlowRuleId = 10164 ) and Escl_Datetime < #T AND Escl_UserId=#U))"

I am not sure is i can modify this ands make it work, and not sure where i would make the modifications.

All Replies
  • HI Mmaloney

    You're looking at this bit

    datediff(d,getdate(),oppo_targetclose) in (0,1,2,3,4,5)

    Which translate as When the date difference is between 0-5 days .

    To make that 35-45 you could do

    datediff(d,getdate(),oppo_targetclose) > 34 AND datediff(d,getdate(),oppo_targetclose) <46

      CRM Consultant

    Pinnacle Computing Ltd

  • Thank you, I will try this.

  • In this statement "datediff(d,getdate(),oppo_targetclose) in (0,1,2,3,4,5)" , if i was to remove 1 through 5, would that make the notification send when the getdate and oppo_targetclose are equal?

  • In this statement "datediff(d,getdate(),oppo_targetclose) in (0,1,2,3,4,5)" , if i was to remove 1 through 5, would that make the notification send when the getdate and oppo_targetclose are equal?

  • Yes. datediff(d,GETDATE(), oppo_targetclose) = 0 basically means the dates are the same. (Using the command 'IN' is useful if you're looking at more than one value)

      CRM Consultant

    Pinnacle Computing Ltd

  • Thank you again.