I have this T-SQL stored procedure:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE dbo.datealter
@LastChangeDate AS date
AS
BEGIN
SELECT
s.[DivNo]as Division,
SUM(CASE WHEN s.Date = @LastChangeDate
THEN s.SELLINC ELSE 0 END) ActualSales
FROM
[dbo].[NewLayerReports] s
WHERE
s.BRN = 1
GROUP BY
s.[DivNo]
END
GO
When I execute this it works ok.
I am using this stored procedure in a SSRS report. When I execute the SSRS report, it asks me to enter or pick the date.
Here always I wanted a calendar to show last year current month. For example, If I run the report on November 2016 the calendar should show Nov 2015.
How can we do this please?
In SSRS parameter, if I set default value then, I couldn't edit the date value. Please see the picture,
Last Change Date
parameter to be this day but in the previous year? – iamdave