0

I have four DateTime columns, all in long format eg 2016-08-01T21:13:02Z. They are called EnqDateTime, QuoteCreatedDateTime, BookingCreatedDateTime and RejAt.

I want to add columns for the duration (in days) between EnquiryDateTime and the other three columns, i.e.

DATEDIF(EnqDateTime, QuoteCreatedDateTime, day)

This works for RejAt, but throws an error for all the other columns:

Parameter "rhs" accepts only ["Datetime"]

As per the image below, all four columns are DateTime.

Column setup showing working RejAt DATEDIFF

Can anyone see any other reason this may not be working for 2 of the three columns?

Adam Hopkinson
  • 28,281
  • 7
  • 65
  • 99

1 Answers1

0

As you can see in the image below, I reproduced an scenario such as the one you presented here, and I had no issue with it. I create the three columns X2Y using the same formula that you shared:

DATEDIF(EnqDateTime, QuoteCreatedDateTime, day)
DATEDIF(EnqDateTime, BookingCreatedDateTime, day)
DATEDIF(EnqDateTime, RejAt, day)

enter image description here

My guessing is that, for some reason, the columns do not have an appropriate Datetime format. Maybe you can try applying some transformations to the data in order to make sure that the data contained in the columns has the appropriate format. I recommend that you try doing the following:

  • Clean all missing values, clicking on the column and then Clean > Missing > Fill with NULL. Missing values can prevent Dataprep from recognizing a data type properly.
  • Change the data type again to Datetime, just to doublecheck that there is not any field that does not have the Datetime type. You can do so by clicking on the column and then Change type > Date/Time.

If these methods do not solve your issue, maybe you can try working with a minimal example, having only a few rows, so that you can narrow down the variables with which to work. Then you can update your question with more information.

It would also be nice to know where are you getting the error Parameter "rhs" accepts only ["Datetime"]. It is not clear for me what the rhs (Right Hand Side) parameter is in this case, so maybe you can also provide more details about that.

dsesto
  • 7,864
  • 2
  • 33
  • 50