Hello,
I have a temp table and i have a date column. i want to use the DATEADD(day, 1, messagedate) method to REPLACE the existing data in the table.
i'm trying something like this, but it is wrong.
DECLARE @mydate datetime
use tempdb
update ##mtable
set @mydate = dateadd(day, 1, messagedate)
set messagedate = @mydate
or i tried this:
set messagedate = dateadd(day, 1, messagedate)
can someone please tell me what i'm doing wrong, or how i can fix this?
thanks in advance...
I have a temp table and i have a date column. i want to use the DATEADD(day, 1, messagedate) method to REPLACE the existing data in the table.
i'm trying something like this, but it is wrong.
DECLARE @mydate datetime
use tempdb
update ##mtable
set @mydate = dateadd(day, 1, messagedate)
set messagedate = @mydate
or i tried this:
set messagedate = dateadd(day, 1, messagedate)
can someone please tell me what i'm doing wrong, or how i can fix this?
thanks in advance...