-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter12.amp
More file actions
32 lines (25 loc) · 1.14 KB
/
chapter12.amp
File metadata and controls
32 lines (25 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%%[
/* Declare variables */
var @dateColumn, @datelater, @dateValue, @dataExtensionName
var @attributeToSearch, @valueToSearch
/* Set the name of the data extension to be used */
set @dataExtensionName = "My_DataExtension"
/* Set the attribute to search by in the data extension */
set @attributeToSearch = {{attributeToSearch}}
/* Set the value to search for in the given attribute */
set @valueToSearch = {{valueToSearch}}
/* Replace with the name of the date column to fetch */
set @dateColumn = {{datecolumn}}
/* Fetch the date value from the data extension */
set @dateValue = LookUp(@dataExtensionName, @dateColumn, @attributeToSearch, @valueToSearch)
/* Validate if a value was returned */
if not empty(@dateValue) then
/* Add one day to the @dateValue value */
set @datelater = DateAdd(@dateValue, 1, 'D')
/* Output the new date value */
OutputLine(concat("New Date: ", v(@datelater)))
else
/* Handle cases where no date is returned */
OutputLine("No valid date found in the data extension.")
endif
]%%