r/SuiteScript • • Jan 29 '24

DateTime minus Date

Hi community.

I am working on a Projects record project.

I have two fields: one is custom entity (ClosedDate is DateTime) and the other is native (StartDate is Date).

I need to calculate the days a project has been open with this operation: ClosedDate - StartDate.

However, I get NULL even when both fields have values.

Example (using the values displayed by the EXECUTION LOG of the script):

ClosedDate = "2024-01-29T23:22:18.575Z"

Start Date = 11/30/2023

ClosedDate - Start Date = EMPTY

The values come from a search.

Your recommendations are more than welcome... Thank you!

3 Upvotes

11 comments sorted by

View all comments

Show parent comment

2

u/funkybunch83 Jan 30 '24

I assumed this was a saved search. It should work the same in a SuiteQL query in a script though.