How can I return the current day of the month as a...
# suiteanalytics
b
How can I return the current day of the month as a single number in a search? For example, today would just be '8'.
s
Formula (Numeric) result field, with formula:
EXTRACT(DAY FROM {today})
c
TO_CHAR(SYSDATE,'DD')
Millions of ways of doing this one 😉
✔️ 1
b
Awesome, thank you!
s
you can either use {today} or SYSDATE for either as well. Just know that SYSDATE uses the current date/time of the NetSuite backend database, while {today} is generated by the NetSuite application servers, so there may be differences, based on timezone.
b
TO_CHAR({today},'DD') is working as expected
Which I think will match with my instance's time zone.
but, how could I get the day of the YEAR?
s
subtly different, but
TO_CHAR({today},'DDD')
will give you the day of year instead of day of month
👍 2
b
Perfect, thanks for your help.