Pardon me, I was trying hard to find the answer, but most of the questions are related in the forum related to converting one value, not the whole set.
I am trying to pass the subquery values to the main query but the subquery returning varchar
and the main query column is accepting smallint
. I tried cast and convert but didn't help me.
select time_off_type_no
from schedtime
where activity_no in (select AT_NUMBERS from ACTIVITY where AT_ID = 105)
This query is throwing the following exception
Conversion failed when converting the varchar value '483,484,485,486,487,488,489' to data type smallint
Any advice on how to convert the values much appreciated.
Following query returning '483,484,485,486,487,488,489' and I want to convert all the values to SmallInt
or int
to pass it to the main query.
select AT_NUMBERS
from ACTIVITY
where AT_ID = 105