简体   繁体   English

Netsuite - 为过去一小时内创建的日期编写保存的搜索公式

[英]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.我正在尝试编写一个公式,当日期在过去 30 分钟内时,该公式将返回交易列表的记录。

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

Netsuite uses PL/SQL semantics for formula fields and date arithmetic in formulas. Netsuite 对公式字段和公式中的日期算术使用 PL/SQL 语义。

if you use a Formula (Numeric) criteria you can do {now} - {datecreated} <= .020833如果您使用公式(数字)标准,您可以执行{now} - {datecreated} <= .020833

where days are integer values and fractions of a day are fractions of 24 hours so .5/24 = .020833其中天是整数值,一天的分数是 24 小时的分数,所以.5/24 = .020833

The method I use I prefer converts the difference (a decimal where 1 represents 24 hours) into hours or minutes:我更喜欢使用的方法将差异(十进制,其中 1 代表 24 小时)转换为小时或分钟:

Hours小时

Criteria Formula: ({now} - {datecreated}) * 24标准公式: ({now} - {datecreated}) * 24

Formula (Numeric): is less than or equal to公式(数值): is less than or equal to

Value: 0.5值: 0.5

Minutes分钟

Criteria Formula: ({now} - {datecreated}) * 24 * 60标准公式: ({now} - {datecreated}) * 24 * 60

Formula (Numeric): is less than or equal to公式(数值): is less than or equal to

Value: 30价值: 30

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM