on 01-27-2015 9:54 PM
We use the Description in Foreign Lang. field on the Item master to store the item's revision number. I need to create an alert for our cost accountant when that value is updated. Preferably I'd like to display: Item ID, previous value (Description in Foreign Lang.), new value (Description in Foreign Lang.), last update date.
Hi,
Try this query:
SELECT T0.[UpdateDate],T0.[ItemCode], T2.[FrgnName] as Newvalue, T1.[FrgnName] as oldvalue, t3.[U_Name] as CreatedUser, t4.[U_Name],T0.[UpdateDate] FROM AITM T0 left join AITM T1 on t1.itemcode = t0.itemcode and t1.loginstanc = t0.loginstanc left join OITM T2 on t2.itemcode = t0.itemcode left join OUSR t3 on t3.userid = t2.usersign left join OUSR t4 on t4.userid =t2.usersign2 WHERE T2.[FrgnName] <> T1.[FrgnName] and datediff(dd,T1.[UpdateDate],getdate()) =0 group by T0.[UpdateDate],T0.[ItemCode], T2.[FrgnName], T1.[FrgnName],t3.[U_Name],t4.[U_Name],T0.[UpdateDate] order by T0.[UpdateDate]
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you both for your suggestions. I appreciate your your time involved.
Regards,
Tony Banks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try:
SELECT T0.[ItemCode], T1.[FrgnName] as Newvalue, T0.[FrgnName] as oldvalue,T0.[UpdateDate],MAX(T0.loginstanc)
FROM OITM T1
join AITM T0 on t1.itemcode = t0.itemcode
WHERE T1.[FrgnName] <> T0.[FrgnName]
group by T0.[ItemCode], T1.[FrgnName], T0.[FrgnName],T0.[UpdateDate]
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
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.