Running Specific Date Inquiries and Reports with Acumatica

Posted by Mike Aichinger on July 28, 2015


Using the DateAdd (date, interval, number)
     

Often, we need reports or lists based on different date ranges from our data.  For example, expiring licenses within the next 30 or 60 days, shipments due for the next week, etc.  

With Acumatica, you can use the formula DateAdd (date, interval, number) to extract information based on specific date ranges.  This formula returns a new calculated date by adding a specific number of intervals to the date (where interval can be years, months, weeks, or days).

For instance, I’m going to extract all the shipments due today and within the next 9 days using the formula:  =DateAdd(today(),’d’, 9)

The formula allows to use dynamics values on it instead of using parameters and having conditions such as Date1 is Greater than and Date2 is Less than.

Below is the complete syntax of the formula:
The formula will return a new date calculated by adding the specified number (nbr) of time intervals (int) to the date (dt). The int argument specifies the type of time interval, and is one of the following options:

y - A number (nbr) of years will be added to the specified date (dt).
q - A number (nbr) of quarters will be added to the specified date (dt).
m - A number (nbr) of months will be added to the specified date (dt).
y - Same as d; see below.
d - A number (nbr) of days will be added to the specified date (dt).
w - A number (nbr) of weekdays will be added to the specified date (dt).
ww - A number (nbr) of weeks will be added to the specified date (dt).
h - A number (nbr) of hours will be added to the specified date (dt).
n - A number (nbr) of minutes will be added to the specified date (dt).
s - A number (nbr) of seconds will be added to the specified date (dt).

Examples:

DateAdd($DueDate, 'm', -2)
DateAdd(CDate('31/01/1995'), 'm', -2)
DateAdd($DueDate,'y', -2)
DateAdd(Cdate($DueDate), 'd', -2)

Note:  In three of the above examples, DueDate ($DueDate) is a report variable.

Contact Crestwood Associates for more information at Marketing@Crestwood.com.


Share this:
 
 

Comments:

Add your comment: