Hi, "formulanumeric:case when EXTRACT(month FROM {...
# suitescript
s
Hi, "formulanumeric:case when EXTRACT(month FROM {birthdate})=EXTRACT(month FROM sysdate) and EXTRACT(day FROM {birthdate})=EXTRACT(day FROM sysdate) then 1 else 0 end" i am using sysdate but rather than that i need to pass date object......how can i use in scriptting
w
Maybe like this
Copy code
const dateString = new Date().toISOString().split('T')[0]
const formula = `formulanumeric:case when EXTRACT(month FROM {birthdate})=EXTRACT(month FROM to_date(${dateString},'YYYY-MM-DD')) and  EXTRACT(day FROM {birthdate})=EXTRACT(day FROM to_date(${dateString},'YYYY-MM-DD')) then 1 else 0 end`