![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi I have an Insert trigger that returns data relating to the record that has just be inserted. How can I amend this query to limit the InvNarration.Text that is selected to InvNarration.TextType = 'P' Thanks for any help A FYI - here is the query SELECT DISTINCT GRD.Supplier, GRD.Grn, GRD.Journal, GRD.JournalEntry, GRD.GrnSource, IST.Serial, GRD.PurchaseOrder, GRD.PurchaseOrderLin, GRD.StockCode, GRD.QtyReceived, GRD.QtyUom, GRD.DeliveryNote, GRD.OrigReceiptDate, INM.Description, INM.LongDesc, INM.DrawOfficeNum, APA.SupAddr1, APA.SupAddr2, APA.SupAddr3, APM.SupplierClass, APA.SupAddr5, APA.SupAddr4, APA.SupPostalCode, IJD.Notation, IJD.RejectCode, APM.SupplierName, dbo.InvNarration.Text FROM dbo.GrnDetails GRD INNER JOIN dbo.InvJournalDet IJD ON GRD.Journal = IJD.Journal AND GRD.JournalEntry = IJD.EntryNumber AND GRD.GrnYear = IJD.JnlYear AND GRD.GrnMonth = IJD.JnlMonth INNER JOIN dbo.ApSupplier APM ON GRD.Supplier = APM.Supplier INNER JOIN dbo.ApSupplierAddr APA ON GRD.Supplier = APA.Supplier INNER JOIN dbo.InvMaster INM ON GRD.StockCode = INM.StockCode LEFT OUTER JOIN dbo.InvNarration INV ON GRD.StockCode = INV.StockCode LEFT OUTER JOIN dbo.InvSerialTrn IST ON GRD.Grn = IST.Reference Where exists( select 1 from inserted ins where ins.Grn = GRD.Grn and ins.Journal = GRD.Journal and ins.JournalEntry = GRD.JournalEntry and ins.GrnSource = GRD.GrnSource) and |
![]() |
| Thread Tools | |
| Display Modes | |
| |