Viewing 6 posts - 1 through 6 (of 6 total)
December 12, 2018 at 10:12 am
This was the requirement from client not to use function as this query will be used is different programming language.
I got couple of solution from a different forum...
December 3, 2018 at 8:26 am
DECLARE @StartDate date = 'Jan 1, 2015'
DECLARE @EndDate date = DATEADD(DAY, 30, @StartDate)
;WITH cte AS (
SELECT @StartDate AS...
May 26, 2015 at 1:41 pm
Thank you . It worked.
May 26, 2015 at 1:27 pm
ok lets take todays date May 20th
The output should be like
Date Order1 Unit Day31
May20 90909 5 128
May19 90909 ...
May 20, 2015 at 2:59 pm
The past 31 days based on todays date.
for example
WHEN (datediff(dd,INSV_DATE,'2015-01-20')) >= 31 THEN 31
WHEN (datediff(dd,INSV_DATE,'2015-01-21')) >= 31 THEN 31
WHEN (datediff(dd,INSV_DATE,'2015-01-22')) >= 31 THEN 31 and so on..
May 20, 2015 at 2:32 pm
Viewing 6 posts - 1 through 6 (of 6 total)