Search code examples
sqlcrystal-reportsfilepath

Add Increment to create a path on SQL to be used for a CrystalReport


I am trying to come up with a the correct path for my Crystal report to pick the correct .pdf files. Here is what I have on SQL:

CASE 
    WHEN pd.pdCode like 'CUST%'
    THEN 'Y:\300 ORDER PROCESSING\Majid Ahmadi\' + CAST(ord.ordPONumber as nvarchar(25)) + '_Custom' + '.pdf'     --Added 2018-05-23 by MA
    ELSE Null
    END AS imageFilePath

And results:

Y:\300 ORDER PROCESSING\Majid Ahmadi\53244_Custom.pdf

Problem is I have multiple files that I want to pick. Like: enter image description here

(picture in the link)

Any suggestion to modify my path?


Solution

  • Could use change the THEN to

    THEN 'Y:\300 ORDER PROCESSING\Majid Ahmadi\' + CAST(ord.ordPONumber as nvarchar(25)) + '_' + pd.pdCode + '.pdf'