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: 
First of all convert `@date` and `@time` variables to `NVARCHAR()`, then concat them and after It convert It to `DATETIME` datatype. After It you can use `DATEADD` function on It. Try in following:

```
DECLARE @date DATETIME 
DECLARE @time TIME

SET @date = GETDATE()
SET @time = '10:12:13'

SELECT DATEADD(DAY, -1, CAST(CONVERT(NVARCHAR(20), @date, 110) + ' ' +
                             CONVERT(NVARCHAR(20), @time, 108) AS DATETIME))

```

**OUTPUT** (*Today day -1 + time '10:12:13'*):

```
2015-07-16 10:12:13.000

```
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

```