October 5, 2005 at 5:39 pm
Does anyone know how to set an attachment path varying by a field in a table?
Set @MyAttachments = '\\genesis\E$\ReportPDF\' +(Select OrganizationID from @tempEmail) + '\' +(Select ProjectID from @tempEmail)+ '\' + 'OpenItem.pdf'
ERROR: Syntax error converting the varchar value '\\genesis\E$\ReportPDF\' to a column of data type int.
I have it declared on top as:
Declare @MyAttachments varchar (1000)
October 5, 2005 at 6:51 pm
Select @MyAttachments = '\\genesis\E$\ReportPDF\' + convert(nvarchar(50), OganizationID ) + '\' + convert(nvarchar(50), ProjectID)+ '\' + 'OpenItem.pdf'
from @tempEmail
_____________
Code for TallyGenerator
October 6, 2005 at 8:15 am
What is happening is that the concatenation of a character type and a numeric type results in an integer type in SQL-Land. So, as hinted in the post above, you need to make sure that all of your numeric values are explicitly converted to a character type before you concatenate them.
October 6, 2005 at 9:47 am
Thank you!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply