0

I am trying to see if a chosen date is between two other dates.

My If/Else statement however is always showing true and displaying "Current date is before week27" despite the condition not being met. here is my code:

%%[

SET @CurrentDate = "August 06, 2020"
SET @WEEK27 = "June 29, 2020"
SET @WEEK28 = "July 06, 2020"
SET @WEEK29 = "July 06, 2020"
SET @WEEK30 = "July 06, 2020"
SET @WEEK31 = "July 06, 2020"
SET @WEEK32 = "August 06, 2020"
SET @WEEK33 = "August 06, 2020"
SET @WEEK34 = "August 06, 2020"
SET @WEEK35 = "August 06, 2020"
SET @WEEK36 = "August 06, 2020"
SET @WEEK37 = "September 06, 2020"
SET @WEEK38 = "September 06, 2020"
SET @WEEK39 = "September 06, 2020"
  
IF @CurrentDate < @WEEK27 THEN
  
]%%

  <p>Current date is before week27</p>
  
%%[
  
ELSE @CurrentDate > @WEEK27

]%%

  <p>Current date is after week27</p>
  
%%[
  
ENDIF

]%%
  
Mesasge: %%=v(@mesage)=%%<br><br>
CurrentDate: %%=v(@CurrentDate)=%%<br><br>
Week27: %%=v(@WEEK27)=%%<br><br>
Week28: %%=v(@WEEK28)=%%<br><br>
Week29: %%=v(@WEEK29)=%%<br><br>
Week30: %%=v(@WEEK30)=%%<br><br>
Week31: %%=v(@WEEK31)=%%<br><br>
Week32: %%=v(@WEEK32)=%%<br><br>
Week33: %%=v(@WEEK33)=%%<br><br>
Week34: %%=v(@WEEK34)=%%<br><br>
Week35: %%=v(@WEEK35)=%%<br><br>
Week36: %%=v(@WEEK36)=%%<br><br>
Week37: %%=v(@WEEK37)=%%<br><br>
Week38: %%=v(@WEEK38)=%%<br><br>
Week39: %%=v(@WEEK39)=%%<br><br>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.