Link to home
Start Free TrialLog in
Avatar of gianitoo
gianitoo

asked on

help with notification email syntax

i am trying to send an email if this query below has matches.  i get an error.  could you help to make sure i have all single quotes



IF EXISTS (SELECT     1
FROM         legalcontract
WHERE     (expired = 1) AND (Triggerdate >= CONVERT(varchar(10), GETDATE(), 121)) AND (Triggerdate <= DATEADD(day, 90, CONVERT(varchar(10), GETDATE(),
                      121)))
  EXEC msdb.dbo.sp_send_dbmail
  @recipients=N'gbarraza@justmarketing.com'
  ,@body='Message Body'
  ,@subject ='Message Subject'
  ,@profile_name ='JMI'
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

>i get an error
what error?

ASKER CERTIFIED SOLUTION
Avatar of Answer_Me
Answer_Me
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial