How to delete a datetime value ? | Community
Skip to main content
Level 2
March 7, 2018
Solved

How to delete a datetime value ?

  • March 7, 2018
  • 2 replies
  • 2291 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Amit_Kumar

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

Regards,

Amit

2 replies

Amit_Kumar
Amit_KumarAccepted solution
Level 10
March 9, 2018

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

Regards,

Amit

July 24, 2023

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.