Expand my Community achievements bar.

SOLVED

How to delete a datetime value ?

Avatar

Level 2

Hello

I need to delete a value from a colum which type is datetime

I'm doing it Inside a worflow (update component) because I'm updating other fields

I tried to use the NULL value in my Update compoennt, like I did to erase String value but it does not work.

I have an error message saying that NULL (type: string) does not match with the destination field type (type: datetime).

What should I do in order to delete my dateitme value ?

Thanks for your feedbacks

Corinne

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Corinne,

Since DateTime is a value type you cannot assign null to it, but exactly for these cases (absence of a value), You can set a DateTime variable to MinTime but the variable itself cannot be null. To get this MinTime use: ToDateTime() as expression with empty params. which will set your date to 02-01-1900 00:00:00

1438621_pastedImage_0.png

Regards,

Amit

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Corinne,

Since DateTime is a value type you cannot assign null to it, but exactly for these cases (absence of a value), You can set a DateTime variable to MinTime but the variable itself cannot be null. To get this MinTime use: ToDateTime() as expression with empty params. which will set your date to 02-01-1900 00:00:00

1438621_pastedImage_0.png

Regards,

Amit

Avatar

Level 1

Interestingly, within Adobe Campaign Standard, if you have a second dateTime field in your custom resource that does have an empty dateTime value, you can enrich this empty field as additional data, and update the destination field with this empty source field.

 

This may not be possible for bulk data updates, unless you can guarantee that the source field is empty for all records.