I have to create a landing page that allows the modification of an existing record and for that, I have to generate the information about the records so he can update it. I already finished the page with HTML and JS and when I add the AMPScript code I'm getting the following error message:
Invalid value specified for function parameter.
Function Name: DatePart
Parameter Name: Date
Parameter Ordinal: 1
Parameter Type: Date
Submitted Value: System.Data.DataRow
ClientID: 7221705
JobID: 0
ListID: 15425
BatchID: 0
SubcriberID: 327073156
Data Source Type: List
This is my AMP Script code:
%%[
/* Set Variables here for easy editing */
SET @uid = AttributeValue("UID_TARGET")
SET @rows = LookupRows("ENT.CUSTOMER_LOT_6", "UID_TARGET", @uid)
SET @count = RowCount(@rows)
IF (@count == 1) THEN
SET @row = row(@rows,1)
SET @sexe = Uppercase(field(@row,"GENDER"))
SET @firstname = field(@row,"FIRSTNAME")
SET @lastname = field(@row,"SURNAME")
SET @email = field(@row,"EMAIL")
SET @tel = field(@row,"PHONENUMBER")
SET @date = field(@date,"BIRTHDATE")
/* SET @langue = field(@row,"PREFERRED_LANGUAGE" */
SET @year = DatePart(@date,"Y")
SET @month = DatePart(@date,"M")
SET @day = DatePart(@date,"D")
IF EMPTY(@date) AND ISNULL(@date) THEN
SET @Date=""
ELSE
SET @Date=CONCAT(@day,"/",@month,"/",@year)
ENDIF
ENDIF
]%%