Reputation: 31
I am trying to write a formula that will return the Records for a list of transactions when the Date is within the last 30 minutes.
Something like this - Obviously the code below is very much not going to work but this is the result I am trying to achieve.
CASE WHEN SYSDATE - {Datecreated} IS WITHIN 30 MINUTES THEN 1 ELSE 0 END
Upvotes: 1
Views: 6742
Reputation: 3205
The method I use converts the difference (a decimal where 1 represents 24 hours) into hours or minutes:
Criteria Formula: ({now} - {datecreated}) * 24
Formula (Numeric): is less than or equal to
Value: 0.5
Criteria Formula: ({now} - {datecreated}) * 24 * 60
Formula (Numeric): is less than or equal to
Value: 30
Upvotes: 4
Reputation: 15377
Netsuite uses PL/SQL semantics for formula fields and date arithmetic in formulas.
if you use a Formula (Numeric) criteria you can do {now} - {datecreated}
<= .020833
where days are integer values and fractions of a day are fractions of 24 hours so .5/24 = .020833
Upvotes: 8