Skip to main content

SQL Year function not working for dynamic attachments in Print and Delivery

Comments

1 comment

  • Alessandro Lopez Santinelli

    Hi Paul, try this:

    Select '\\b1_shr\attachements\picklists\'+SUBSTRING(CONVERT(varchar, docdate, 112), 1, 4)+'\'+CHOOSE(month(DocDate),'January','February','March','April','May','June','July','August','September','October','November','December')+'\P-'+cast(docnum as varchar)+'.pdf'from oinv where DocEntry=DocKey@

    regards

     

Please sign in to leave a comment.