Hello
we try to use a database for a test. We write into a table the date of two days ago and of three days ago. These dates are our variables in the test.
The problem: The dates are not updated (example: variables two days ago 14/7 and 15/7, variables of today 14/7 and 15/7, but it should be 16/7 and 17/7)
Our stored procedure:
USE [DATABASE]
GO
/****** Object: StoredProcedure [dbo].[Listsearch_Report_Dates_Procedure] Script Date: 19.07.2017 12:25:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Listsearch_Report_Dates_Procedure]
AS
BEGIN
Update dbo.Listsearch_Report_Dates
Set Vorgestern = CONVERT(VARCHAR(6), getdate()-2, 4),
Vorvorgestern = CONVERT(VARCHAR(6), getdate()-3, 4)
select * from Listsearch_Report_Dates
END