I have a crystal report that lists invoices and I would like to be able to show the file path of the invoices of the invoices in another column of the report.
DECLARE @entryID INT = 35793 SELECT dbo.toc.name AS DocumentName, dbo.doc.pagenum + 1 AS PageNum, dbo.vol.fixpath + '\' + SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),1,2) + '\' + SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),3,2) + '\' + SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),5,2) + '\' + CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2) + '.TIF' AS FullPathAndFilename FROM dbo.doc LEFT JOIN dbo.toc ON dbo.doc.tocid = dbo.toc.tocid LEFT JOIN dbo.vol ON dbo.toc.vol_id = dbo.vol.vol_id WHERE dbo.doc.tocid = @entryID ORDER BY dbo.doc.pagenum
After searching on the answers site, I found this query which finds the file path of a specific document that you input the tocid for. I am having some trouble having this query apply to all of the documents listed in the Crystal Report. Any help would be greatly appreciated.