It tries to compare int with the string value '+ @buildingsIDs +'
Therefore, it tries to convert the string to convert it to int and failed.
So do the following:
buildingsIDs = "1, 5, 6";
@"SELECT id, startDateTime, endDateTime From tb_bookings WHERE buildingID IN (" + buildingIDs + ") AND startDateTime <= @fromDate";
source share