on 05-20-2022 5:51 AM
Dear all,
can someone help me to alter this code because if I using Union then the golden arrow won't appear:
SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, T0.U_confirmed, t1.Price<br>FROM ODRF T0 <br>INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry] <br>WHERE T0.[ObjType] =59 and DocStatus='O' and T0.U_confirmed='No'<br>union all<br>SELECT t0.docentry as 'Draft Number', T1.[DocNum], T0.[DocDate], T1.Comments as Remark, T1.U_confirmed, t0.Price<br>FROM DRF1 T0 <br>INNER JOIN ODRF T1 ON T0.[DocEntry] = T1.[DocEntry] <br>WHERE T0.[ObjType] =59 and DocStatus='O' and T1.U_confirmed='Yes' and t0.Price=0
Hi,
Try this
SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, T0.U_confirmed, t1.Price
FROM ODRF T0
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[ObjType] =59 and DocStatus='O' and
(T0.U_confirmed='No' or (T0.U_confirmed='Yes' and t1.Price=0))
Hope this helps,
Son Tran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you use the query above? Did it help?
Check this:
SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark,
CASE
WHEN T0.U_Confirmed = 'Yes' and T1.Price = 0 THEN 'YES'
WHEN T0.U_Confirmed = 'No' and T1.Price >= 0 THEN 'NO'
END AS 'Confirmed',
t1.Price
FROM ODRF T0
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[ObjType] =59 and DocStatus='O'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The Union All will remove the navigation arrow. You can check the earlier discussion on it in following thread:
If, however, your fields are same for both queries and its just the UDF (U_Confirmed) which is different and you want to merge the result, check below if it helps:
SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark,
CASE
WHEN T0.U_Confirmed = 'Yes' THEN 'YES'
WHEN T0.U_Confirmed = 'No' THEN 'NO'
END AS 'Confirmed',
t1.Price
FROM ODRF T0
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[ObjType] =59 and DocStatus='O'
KR,
Jitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jitin.chawla
actually I to create new alerts and the results should be like this : if t0.u_confimed ='Yes' but t1.price=0 then it will trigger an alerts. if t0.u_confirmed = 'No' also triggered an alerts. I want this both condition in one alerts and the results should be like this :
but when i union it, the golden arrow won't appeared. Please help!
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.