SHARE
TWEET

Untitled

a guest Jun 16th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WHILE @Iteration != 1000000
  2.     BEGIN
  3.         WHILE @Mth <= 12
  4.             BEGIN
  5.                 UPDATE TACC
  6.                 SET BUSINESSDATE =
  7.                 CASE
  8.                     WHEN DAY([BUSINESSDATE])<13  
  9.                     THEN datefromparts(year([BUSINESSDATE]), @Mth, 1)  
  10.                     WHEN DAY([BUSINESSDATE]) BETWEEN 13 AND 24
  11.                     THEN datefromparts(year([BUSINESSDATE]), @Mth, 2)
  12.                     ELSE datefromparts(year([BUSINESSDATE]), @Mth, 3)
  13.                 END
  14.                 SET @Mth = @Mth + 1
  15.                 IF @Mth=13
  16.                     BEGIN  
  17.                         SET @Mth=1
  18.                     END
  19.             END
  20.         SET @Iteration = @Iteration + 1
  21.     END
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top