Enare
Enare

Reputation: 31

Netsuite - Writing a Saved Search Formula for Date Created within last hour

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

Answers (2)

ChrisB
ChrisB

Reputation: 3205

The method I use converts the difference (a decimal where 1 represents 24 hours) into hours or minutes:

Hours

Criteria Formula: ({now} - {datecreated}) * 24

Formula (Numeric): is less than or equal to

Value: 0.5

Minutes

Criteria Formula: ({now} - {datecreated}) * 24 * 60

Formula (Numeric): is less than or equal to

Value: 30

Upvotes: 4

bknights
bknights

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

Related Questions