Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

AMPscript Current Sunday

$
0
0

I'm attempting to build a call by date and have that date be the Saturday of the given week. These emails are sent Monday - Friday, I'm struggling to lock down the AMPscript for it. Here is what I have so far.

%%[var @currentDate, @currentDayOfWeek, @daysUntilSaturday, @nextSaturday, @monthName, @day, @year SET @currentDate = NOW(1)SET @currentDayOfWeek = DATEPART(@currentDate, "D")SET @daysUntilSaturday = 7 - @currentDayOfWeek + 1SET @nextSaturday = DATEADD(@currentDate, @daysUntilSaturday, "D")SET @monthName = ProperCase(FormatDate(@nextSaturday, "MMMM"))SET @day = DatePart(@nextSaturday, "D")SET @year = DatePart(@nextSaturday, "Y")]%%%%=v(@monthName)=%% %%=v(@day)=%%, %%=v(@year)=%%

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>