I am trying to insert a row if date_start (type datetime) is in past and date_start+duration(type; real) (gets the end date.) is in future. I keep getting 'more than one result returned from sub query.
IF  (CAST(CONVERT(datetime,(SELECT date_start FROM [tableA])) as float)- CAST(CONVERT(datetime,CURRENT_TIMESTAMP) as float))<0 
AND 
(24*(CAST(CONVERT(datetime, (SELECT date_start FROM [tableA])) as float)- CAST(CONVERT(datetime,CURRENT_TIMESTAMP) as float)) + (SELECT duration FROM [tableA]))>0
BEGIN
        INSERT INTO [tableB](col1) 
    select 24*(CAST(CONVERT(datetime,date_start) as float)- CAST(CONVERT(datetime,CURRENT_TIMESTAMP) as float))  FROM [tableA]
END
Any idea how can i do this?
