I’m trying to rewrite an existing saved search int...
# suitescript
j
I’m trying to rewrite an existing saved search into SuiteQL. One of the columns compares a custom field (of time Date/Time) with the current time, and provides the difference in seconds. Here’s the formula as it appears in the Saved Search
Copy code
((CAST(current_timestamp AS DATE) - CAST({custrecord_check_datetime} AS DATE)) * 86400
b
You have an extra leading parenthesis here. Not sure if that's the issue.
j
that one’s not the problem
sorry should have been
Copy code
(CAST(current_timestamp AS DATE) - CAST({custrecord_check_datetime} AS DATE)) * 86400
it’s the SuiteQL version that fails
w
wiiiieeerd
(current_timestamp - trandate) *24*60*60
that calculation works (but the display of it is not in seconds)
but not (current_timestamp - trandate)*86400
It seems as it can't multiply with a large number if it reaches a certain number within that calculation-step?? I had 2021-03-03 as trandate, and at first I could multiply by 25670 but each second I had to lower that number. But splitting it up into 24*60*60 still works.
j
what the hell
that’s peculiar AF
it’s only kinda-sorta giving me a sensible result