RE: Best Method to obtain difference in days between two dates?

What is the best method to obtain the difference in days between a Date and a DateTime?

I have a Transaction Record (Work Order) with two fields:


InternalId: actualproductionenddate

Type: date



InternalId: createddate

Type: datetime

In Analytics Dataset I have tried to create a Formula Field using the following:


{actualproductionenddate}-CAST_TO_DATE({createddate})

The intention is to cast {createddate} of type datetime to a type date and subtract it from {actualproductionenddate}.

Ideally the result should generate the number of whole days between these dates.
Instead I am getting decimal values and I am unsure why.

Sample Data :
Date Create: 3/31/2021 4:29 pm
Actual Production End Date: 3/31/2021
Formula Result: -0.69

nathanw Beginner Asked on May 14, 2024 in SuiteAnalytics.
Add Comment
1 Answers
Best answer

I’ve just looked through some of my examples and I’ve used TRUNC() on the dates before subtracting.

Advanced Answered on May 16, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.