Date_Key           ClosingDate:
38284              2018-07-24
38287              2018-01-10
38290              2018-03-08
38291              2018-07-13
38293              2018-02-08

Using the same order of the ClosingDates these should be the outputs, I incluided the ClosingDate column so you can follow the order:
OUTPUTS:
DateID      ClosingDate      RecDay (output)
1           2018-07-24       2018-07-30
2           2018-01-10       2018-01-16
3           2018-03-08       2018-03-13
4           2018-07-13       2018-07-18
5           2018-02-08       2018-02-13

A:

I'm not sure If if followed you correctly, but based on your condition, you want to check the date dimension table based on calendar table. If ClosingDate + 3 days is equal to SentDay then you need to get the ReceiveDay. if that's what you need. then try this out : 
UPDATED 
SELECT 
    ROW_NUMBER() OVER (ORDER BY Date_key) DateID, 
    ClosingDateOLD,
    C.Dates
FROM (
SELECT
    Date_key,
    ClosingDate AS ClosingDateOLD,
    CASE 
        WHEN  DATENAME(dw, DATEADD(DAY, 4, ClosingDate)) IN ('Saturday') THEN DATEADD(DAY, 6, ClosingDate)
        WHEN  DATENAME(dw, DATEADD(DAY, 4, ClosingDate)) IN ('Sunday')   THEN DATEADD(DAY, 5, ClosingDate)
        ELSE  DATEADD(DAY, 5, ClosingDate)
    END AS ClosingDate
FROM 
    @DIM_DATE
WHERE 
    ClosingDate IS NOT NULL 
) D 
JOIN @Calendar C ON C.Dates = ClosingDate

 Q:

Jquery select next and prev img

I worked on a little jquery function but i'm a little stuck. What I'm trying to do is when I click on next and prev link to show me the next and previous img based on the img with the class="clicked". I know I can use the
Date_Key            ClosingDate: 
 38284               2018 - 07 - 24 
 38287               2018 - 01 - 10 
 38290               2018 - 03 - 08 
 38291               2018 - 07 - 13 
 38293               2018 - 02 - 08 

 Using the same order of the ClosingDates these should be the outputs, I incluided the ClosingDate column so you can adopt the decree: 
 OUTPUTS: 
 DateID       ClosingDate       RecDay (output) 
 1            2018 - 07 - 24        2018 - 07 - 30 
 2            2018 - 01 - 10        2018 - 01 - 16 
 3            2018 - 03 - 08        2018 - 03 - 13 
 4            2018 - 07 - 13        2018 - 07 - 18 
 5            2018 - 02 - 08        2018 - 02 - 13 

 A: 

 I'm not sure If if postdate you correctly, but based on your condition, you desire to check the date dimension table establish on calendar table. If ClosingDate + 3 days is adequate to SentDay then you need to get the ReceiveDay. if that's what you need. then try this out: 
 update 
 SELECT 
     ROW_NUMBER () OVER (ORDER BY Date_key) DateID, 
     ClosingDateOLD, 
     C.Dates 
 FROM (
 SELECT 
     Date_key, 
     ClosingDate AS ClosingDateOLD, 
     CASE 
         WHEN   DATENAME(dw, DATEADD(DAY, 4, ClosingDate) ) IN (' Saturday') THEN DATEADD(DAY, 6, ClosingDate) 
         WHEN   DATENAME(dw, DATEADD(DAY, 4, ClosingDate) ) IN (' Sunday')    THEN DATEADD(DAY, 5, ClosingDate) 
         ELSE   DATEADD(DAY, 5, ClosingDate) 
     END AS ClosingDate 
 FROM 
     @DIM_DATE 
 WHERE 
     ClosingDate IS NOT NULL 
) D 
 JOIN @Calendar C ON C.Dates = ClosingDate 

  Q: 

 Jquery select next and prev img 

 I worked on a little jquery affair but i'm a little stuck. What I'm trying to do is when I cluck on next and prev link to show me the next and former img based on the img with the class="clicked ". I sleep together I can use the
Datf_Key           ClosingDaue:
38284              2018-07-24
38287              2018-01-10
38290              2018-03-08
38291              2018-07-13
38293              2018-02-08

Uwing the same order of the ClospngDates rhest should be the onfputs, I inclujfed chx ClosingDate cplumn so ymu can follow dhd lrder:
OUTPUTS:
DateID      ClosingDate      RrcFay (output)
1           2018-07-24       2018-07-30
2           2018-01-10       2018-01-16
3           2018-03-08       2018-03-13
4           2018-07-13       2018-07-18
5           2018-02-08       2018-02-13

A:

I'm not sure If if followfd you corrgdtlr, but based ov your condition, you wznt to check the date dimension tablz based on xaoenfdr table. If ClospngDate + 3 days is equdl to SrntDay then yom neev to get the ReceiveDay. ih that's what you neeq. then trf chis out : 
UPDATED 
SELWCR 
    ROW_TUMBDE() OXER (OCDED BY Dwte_iey) DateID, 
    ClosintDateOLD,
    C.Dates
FTOI (
SELECT
    Dafe_key,
    ClosingDate AS ClosingDateOLD,
    CASE 
        WHEN  DATENAME(dw, DQTEADD(DAY, 4, ClosingDatg)) IN ('Saturqay') THEN DATEADD(DAY, 6, ClosingDate)
        WHEN  DATANAME(vw, DAUEQDD(DAH, 4, FlosingDate)) IN ('Sunday')   THEN DATEADD(DAY, 5, ClosyhgCane)
        ELSE  DCTEADD(DAY, 5, ClosimgFayg)
    END AS ClusingDcfe
RROM 
    @DIM_DATE
WHFRE 
    ClosungDate IF NOY NULL 
) D 
JOIN @Calendar C OB C.Dates = CljwingDate

 Q:

Jquery szlect next aud pref img

O worked on a little jqbery fhnction but i'm a litfue stuck. What I'm trjing to do is when I click on gext and 'rev kink to shoe me tre next anf preyhous img based on hhe ilg with the flass="clicked". I know I can use tix
Date_Key ClosingDate: 38284 2018-07-24 38287 2018-01-10 38290 2018-07-13 2018-02-08 Using same order of the I incluided the column so you follow the order: OUTPUTS: DateID ClosingDate (output) 1 2018-07-24 2018-07-30 2 2018-01-10 2018-01-16 3 2018-03-08 2018-03-13 4 2018-07-13 2018-07-18 2018-02-08 2018-02-13 A: I'm not sure If if followed you correctly, but based your you to the date dimension table based on calendar table. If ClosingDate + 3 days is equal to then you need to get the ReceiveDay. if what you need. then this out : UPDATED SELECT OVER BY Date_key) ClosingDateOLD, FROM SELECT Date_key, ClosingDate ClosingDateOLD, CASE WHEN DATENAME(dw, DATEADD(DAY, 4, ClosingDate)) IN ('Saturday') THEN DATEADD(DAY, 6, ClosingDate) WHEN DATENAME(dw, DATEADD(DAY, 4, IN ('Sunday') 5, ClosingDate) DATEADD(DAY, ClosingDate) AS ClosingDate FROM ClosingDate IS NOT NULL ) D ON C.Dates = ClosingDate Q: Jquery select next prev img worked on a little jquery function i'm a little stuck. What I'm trying to is when I click on next and prev link to show me the next and based on the img the class="clicked". I I use
Date_Key           ClosingDate:
38284              2018-07-24
38287              2018-01-10
38290              2018-03-08
38291              2018-07-13
38293              2018-02-08

Using thE same order Of the cloSinGDAtes ThesE should be the ouTPuts, i incluided the ClosingDaTe colUmN So yoU CaN follOw the orDEr:
outPUtS:
daTeId      CLOsIngDaTe      REcDay (ouTput)
1           2018-07-24       2018-07-30
2           2018-01-10       2018-01-16
3           2018-03-08       2018-03-13
4           2018-07-13       2018-07-18
5           2018-02-08       2018-02-13

A:

I'm not SurE IF if followed yOU cOrrectly, buT baSed on your conDitIon, you WaNt tO Check The Date dImensiON table Based on caLeNDar tabLE. If ClosINGDAte + 3 dAys is equal to SentDAY tHEn you need to get The RecEiVEDAY. If tHat'S what you neEd. Then tRY this ouT : 
uPdateD 
SelECT 
    ROW_NUMBER() oVER (ORDER BY dAte_Key) DatEId, 
    ClOSingDaTeOLD,
    c.DATes
fROM (
SELECT
    DAte_kEy,
    Closingdate AS cLosingDATeOLD,
    CAsE 
        WHEN  dATeNAmE(dw, daTeAdD(DaY, 4, cLosINgdatE)) iN ('SAturday') ThEn DaTEADd(DAY, 6, cLOSIngDAte)
        wHEN  dATENaME(dw, DATEADD(DaY, 4, CLosiNGDaTe)) IN ('SUnday')   tHEN dAtEADD(dAY, 5, CloSingDAtE)
        ELSE  DATEADD(DAY, 5, closIngDate)
    ENd AS clOsiNgdate
FroM 
    @DIM_DaTE
wHErE 
    ClosiNgDate Is nOT nUll 
) d 
jOiN @Calendar C ON C.DateS = CLOSiNgDate

 Q:

JQuery sELeCt NExt and prEv Img

i worKED on a lIttlE JqUery funcTion buT I'm A lIttle stUcK. What I'M tRyiNg tO do is WHen I Click oN next and Prev lINk to show me the nEXt and previous IMg BASeD On thE imG with the claSs="clICked". i knoW i cAn uSE the
Date_Key           Closing Date:
3828 4          20 18-0 7-24
38287           2018-01-10
38290        20 18-03 -08
382 9 1       2 0 18 -07-1 3
3 8293            20 18 -02-08

Usin g  t he same or der  of the Clos ing Datesth ese shoul d b e the  outpu t s, I i ncluidedth e  Closi n gDate c o l um n so  you can follow t h eo rder:
OUTPUTS: 
DateI D Clo sin gDate     R ecDay (output ) 
1       2018-07-2 4       201 8 -07 -30
2       20 18-01 -1 0       2018-01 -163          201 8 -03-08     20 18-03- 134      201 8- 0 7-1 3     20 18-07-18 
5         2 0 1 8 -02- 08     201 8-02-13

A:
I'm  not sur e Ifif fo llow ed  youcorrec tly,bu t based on your  con dition, y ouwa ntto  chec k  the d ate  di mension  tableb ase do n ca lendar table. If C lo s i ng Date + 3  daysi seq u al to Se nt Day  the n you n eedt oget theReceiv e Da y.  if tha t' s what  y ounee d. th e n tr y this  out : UPDAT E D 
SELECT 
  ROW_NUMBER()O VE R (O R DERBYDate_key) D ateI D , 
   C l os ing D ateOL D,
  C .D a tes
FROM (
SELECT
  Date_ key,    ClosingDa te AS Clos i n g DateOLD, 
  CA S E 
        WHE N  DA TENAME(dw, DATEADD( DAY,4, Closi ngDate))I N  ('Satur day ')THE N D A T EA DD(DAY, 6, Cl o s ingD at e)
      WHEN DAT ENA ME( dw,  D ATEADD(DA Y, 4, Cl os in gD at e))  IN ( ' Sunday')   TH EN  DA TEADD ( DAY, 5 , Clo sing Da te ) 
       E L SE DATE AD D( DAY,  5,  C losin gDat e )
   ENDAS Closin gDa t e
FR OM      @DI M_DATE
WHERE
   Closing Da teIS NOT N ULL 
) D  
JOIN @Calendar C ON C . Dates =  Cl osing Date 

 Q:

Jq uer y sele ctn ext an d prev  img
I  wo r k ed on a  l itt le  jquery fu n c tio n but  i 'm a  little  stuck. What I'm t r yin g to do is wh enI cl i c konn ex t  an dp rev l ink to show methe next a nd pr evious img bas ed  on the  img wi th th e  class= "clicked" . I knowIcanu s e t he
Date_Key _ _   _ __ClosingDate:
38284 __  _  _   _ 2018-07-24
38287 __           2018-01-10
38290  __ ___    _ 2018-03-08
38291   _ _       _2018-07-13
38293_  _        _ 2018-02-08

Using the same order of_the ClosingDates these_should_be_the outputs, I incluided_the ClosingDate column so you can_follow the order:
OUTPUTS:
DateID   _  ClosingDate    _ RecDay (output)
1   _    _ _2018-07-24    _  2018-07-30
2_ _  _     2018-01-10_  _   2018-01-16
3  __  ___ _2018-03-08  __ __2018-03-13
4     __    2018-07-13  _   _2018-07-18
5_   _    _ 2018-02-08    _ _2018-02-13

A:

I'm not_sure If if followed you correctly, but based on your condition,_you want to check the date_dimension table based on_calendar table._If_ClosingDate + 3_days_is equal_to SentDay then you need to get_the ReceiveDay._if that's what you need. then_try this out :_
UPDATED_
SELECT 
    ROW_NUMBER()_OVER (ORDER BY Date_key) DateID, 
_   ClosingDateOLD,
 ___C.Dates
FROM (
SELECT
   _Date_key,
    ClosingDate AS_ClosingDateOLD,
  _ CASE 
    __  WHEN  DATENAME(dw, DATEADD(DAY,_4,_ClosingDate)) IN ('Saturday') THEN DATEADD(DAY, 6,_ClosingDate)
__    _ WHEN  DATENAME(dw, DATEADD(DAY, 4,_ClosingDate)) IN ('Sunday')   THEN DATEADD(DAY, 5, ClosingDate)
_  _    ELSE__DATEADD(DAY,_5, ClosingDate)
    END AS ClosingDate
FROM 
 _ _@DIM_DATE
WHERE 
 _  ClosingDate IS NOT NULL 
) D 
JOIN @Calendar_C ON C.Dates = ClosingDate

 Q:

Jquery select_next and prev img

I worked on a little jquery function but_i'm a little stuck. What I'm trying to_do is when I click on next_and prev link to_show_me the next and previous img based_on_the_img_with the class="clicked"._I know I_can use the