on 2025 Jan 14 8:11 AM
Hi,
I would like to assign an alert to several users, but the alert should only be received by the user associated with the document.
I use user query:
SELECT 'In' + CAST(DATEDIFF(DAY, CAST(GETDATE() AS DATE),CAST(T1.[CLOSE] AS DATE)) AS nvarchar(MAX)) +' days the task '+ UPPER(CAST(T1.DSCRIPTION AS nvarchar(MAX))) + ' deadline is approaching in project' + UPPER(CAST(T0.Name AS NVARCHAR(MAX)))
FROM
OPMG T0 join PMG1 T1 on T1.AbsEntry = T0.AbsEntry
WHERE CAST(T1.[CLOSE] AS DATE) <= CAST(DATEADD(DAY, 6, GETDATE()) AS DATE) AND CAST(T1.[CLOSE] AS DATE) > CAST(GETDATE() AS DATE)
AND T1.FINISH <> 'Y'
AND T1.U_alert = 'Y'
AND (select UserId FROM OHEM WHERE empID = T1.[OWNER]) = $[USER]
The problem is the syntax $[USER] is not working in alerts.
Do you know how to solve this problem?
Request clarification before answering.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.