garethtnash
asked on
SQL - Conversion failed when converting the varchar value to data type int
Hello, i'm trying to build an MS SQL query, like so -
Select
('/job-search.asp?s=' + JBCID) AS URLOne,
('/job-search.asp?s=' + JBCID + '&' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLTwo,
('/job-search/s-' + JBCID + '/' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLThree,
('/' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLFour
from dbo.JBCategories C Inner Join dbo.JBSite S on C.JBCSiteID = S.JBSSiteID
where JBCSiteID = 30
However when i run the query I get the following error -
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '/job-search.asp?s=' to data type int.
Please advise what i have done wrong? Many thanks
Select
('/job-search.asp?s=' + JBCID) AS URLOne,
('/job-search.asp?s=' + JBCID + '&' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLTwo,
('/job-search/s-' + JBCID + '/' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLThree,
('/' + JBCategoryLabel + '-jobs-in=XXXXX') AS URLFour
from dbo.JBCategories C Inner Join dbo.JBSite S on C.JBCSiteID = S.JBSSiteID
where JBCSiteID = 30
However when i run the query I get the following error -
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '/job-search.asp?s=' to data type int.
Please advise what i have done wrong? Many thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
:) spot on
ASKER