ddf_CommaSeparatedReceipts

This is a function that returns the Receipts that are associated with a Payables document. 

The use of the function is demonstrated here http://dyndeveloper.com/ArticleView.aspx?ArticleID=1689

 

IF OBJECT_ID (N'dbo.ddf_CommaSeparatedReceipts') IS NOT NULL
   DROP FUNCTION dbo.ddf_CommaSeparatedReceipts
GO
   
CREATE FUNCTION dbo.ddf_CommaSeparatedReceipts (@vendorid varchar(15), @docnumbr varchar(21))
   
RETURNS varchar(max)
   
AS
 
 
BEGIN
    declare @Receipt as varchar(max)
    select @Receipt = coalesce(@Receipt + ',','') + rtrim(poprctnm)
        from pop30300 rh
        where rh.VENDORID = @vendorid and rh.VNDDOCNM = @docnumbr
   
    return @Receipt 
END
 
GO

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences