m trying to UPDATE :
IF @usmsopt == "False" THEN
SET @smsoptoutdate = CURRENT DATE
ELSE
SET @smsoptoutdate = CLEAR THE DATE
ENDIF
with the following AMP:
IF @usmsopt == "False" THEN
SET @smsoptoutdate = Now()
ELSE
SET @smsoptoutdate = ""
ENDIF
BUT WHEN @usmsopt == "True"
then instead of emptying the field i get '1/1/1900 12:00:00 AM'
value
any idea??
How about if i do like below ??: based on this:https://code.exacttarget.com/question/forcing-date-field-remain-null
IF @usmsopt == "False" THEN
SET @smsoptoutdate = Now()
ELSE
ENDIF
THE ABOVE (1) WORKED WELL FOR ME FOR CREATE OPERATION . BUT AM TRYING TO WORK STILL ON UPDATE WITHOUT TRYING TO CHANGE THE DATE FIELD AS TEXT IN DE . BASED ON THE LINK : https://code.exacttarget.com/question/end-date-field-getting-default-value
DOES THE FOLLOWING WORK (update an existing value to NULL):
/* to do : here i need to clear the old optout date */
ELSEIF @currentsmsopt == "True" AND @presmsopt =="False" THEN
IF NOT EMPTY(@presmsoptdt) THEN
Var @deo
Set @deo = CreateObject("DataExtensionObject")
SetObjectProperty(@de, "CustomerKey", "DATA EXTENSION")
/* erase the exsting value */
Var @smsoptoutdateproperty
Set @smsoptoutdateproperty = CreateObject("NullAPIProperty")
SetObjectProperty(@enddateproperty, "Name", "smsoptoutdt")
AddObjectArrayItem(@deo, "Properties", @smsoptoutdateproperty)
SET @result = UpsertData("DATA EXTENSION", 1, "custid", @ucustid, "emailaddress", @uemailaddress, "FirstName", @ufirstname, "LastName", @ulastname, "Zip", @uzip, "Mobile", @mobile1, "Phone", @phone, "Country", @ucountry, "Wants_email", @uemailopt, "Wants_sms", @currentsmsopt, "Add_Edit_Date", @editdt, "Optoutdate_sms", @smsoptoutdt, "Optoutdate_email", @emailoptoutdt, "Mobilecode", @countrycode, "Locale", @ulocale, "Signup", @signupdt, "Source", @source, "SubscriberKey", @friendkey)
ENDIF
ENDIF