July 27, 2018 at 8:24 am
CREATE TABLE [dbo].[dt](
[dtVal] [datetime] NOT NULL,
[dtVal2] [datetime] NOT NULL,
PRIMARY KEY CLUSTERED
(
[dtVal] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
I insert a date in the table but I want to have the prev value that I insert in dtVal2
Insert into dt values (GETPREV-dtval2 as dtval), getdate() as dtVal2)
July 27, 2018 at 8:40 am
Srry put the wrong group
July 27, 2018 at 9:39 am
GG_BI_GG - Friday, July 27, 2018 8:40 AMSrry put the wrong group
And what determines what is the previous value? Some sample data and expected results may help.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply