0

I have the following problem:
I imported a csv file in MC and there is a date field in it. When I create the billing_date attribute as text field, all of the csv data will be imported correctly and the date will have the dd.mm.yyyy format. When I create the attribute as date field, around 2/3 of the data gets lost. In my entry data extension is the RechnungsDatum field build in as string as well.

So here is my SQL:

SELECT CONVERT (NVARCHAR, import.billing_date, 104) as RechnungsDatum
.
.
.
AND CAST(import.billing_date AS DATE) BETWEEN DATEADD (dd, -1, CAST(GETUTCDATE() AS DATE)) AND DATEADD (dd, 0, CAST(GETUTCDATE() AS DATE))

I get the following error:

Could not convert date and/or time from string data type.

Do you have an idea how exactly should i convert string to date so that my query would give a result?

1 Answer 1

0

It sounds like the data set you're trying to import has malformed dates if some of the rows loose their data and some dont. If you're unable to get a new file with correct dates or if the files are manually created i would make sure to format all rows to the same correct date formats in Excel.

You can find supported date formats for Salesforce Marketing Cloud here.

2
  • Thank you for the suggestion! It turned out that the date format in the csv. file was german and the one in the MC - english per default, so i managed to upload all the data!
    – Magi
    Apr 27, 2022 at 15:14
  • Good to hear! There is a famous saying in data: crap in, crap out :) make sure to mark the answer if it helped you.
    – Alex
    Apr 27, 2022 at 19:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .