Im stuck with this
I have two tables a schedule calendar and then a table with cars
DECLARE @NOTbooked varchar(1000)
SELECT @NOTbooked = COALESCE(@NOTbooked + ',' ,'') +
CAST(carid AS Varchar(5))
FROM tbCalendar cal
('2010-10-12 10:00' BETWEEN cal.startdate AND cal.enddate) OR
('2010-10-13 10:00' BETWEEN cal.startdate AND cal.enddate)
SELECT * FROM [tbCars] WHERE id NOT IN (@NOTbooked)
In the first select I pick the list of cars booked a certain dates...and with this I get the resultlist '1,2'
and in the second select It doesnt matter what I do I get the same error message
conversion failed when converting the varchar value '1,2' to data type int.
What am I doing wrong?
View Complete Post