Question: I have two variables `@date` of type `datetime` and `@time` of type `time`. I want to add both to get another `datetime` variable. And I want to perform further calculations on it.

Ex: 

```
Declare @date datetime
Declare @time time

```

I want something like this

```
@date = @date + @time (but not concatenation)

SELECT @Startdate = DATEADD(DAY, -1, @date )

```

Is there any way?

Answer: 
The only thing you are missing is that @time needs to be cast back to a datetime before adding to @date.

```
declare @date datetime = '2022-05-26'
declare @time time = '09:52:14'
declare @Startdate datetime

set @date = @date + convert(datetime,@time)

SELECT @Startdate = DATEADD(DAY, -1, @date)

```

Produces:
[![enter image description here](https://i.stack.imgur.com/gp3eh.png)](https://i.stack.imgur.com/gp3eh.png)
I'm not sure what's going on here, but if your variables are datetime and time types, this should work just fine:

```
declare @date datetime
declare @time time

set @date = '20150717'
set @time = '12:34:56'

set @date = @date + @time

select @date, DATEADD(DAY,-1,@date)

```

See [SQL Fiddle](http://sqlfiddle.com/#!3/9eecb7/1978)

If the problem is that @date contains also time part, you can use:

```
set @date = convert(datetime, convert(date, @date)) + @time

```