declare @ sql varchar(150),
set @sql = select To_x,Subject,DATEADD(SECOND, Create_Date-14400, ' Jan 1, 1970') from AR_System_Email_Messages where Subject like '%not acknowledged from past%' and Create_Date > DATEDIFF(s, '1970-01-01 00:00:00', dateadd(d,-10,GETDATE()))
The query mentioned is working fine, but while assigning the output value to the @sql, its throwing error. Please helm me to modify the query so that i can assign the output to the @sql.
Do let me know if you need any further clarification on my request.