Skip to main content
Solved

Formula to get $ sum between two dates

  • Mar 27, 2024 10:17 PM UTC
  • 7 replies
  • 228 views
  • Translate All

Forum|alt.badge.img

On a generic enquiry, how do i get the number/$ sum of invoices etc between to dates?

 

I have seen the threads as to date differnce calculations, but they all seem to be related to getting the amount of days bewteen two dates.  DateAdd( date, interval, number ) etc

 

I want to get for example how much a customer spent in 2021 in a column.

 

Best answer by lauraj46

Hi @dan_00 ,

You could create a formula field on the Results tab similar to this:

=iif(year([ARInvoice.InvoiceDate])=2021, [ARInvoice.CuryOrigDocAmt], 0)

Sum in the Aggregate function column

In the Grouping tab, group on Customer ID

Hope this helps!

Laura

 

View original

7 replies

lauraj46
Captain II
Forum|alt.badge.img+9
  • Captain II
  • Answer
  • Mar 27, 2024 10:47 PM UTC

Hi @dan_00 ,

You could create a formula field on the Results tab similar to this:

=iif(year([ARInvoice.InvoiceDate])=2021, [ARInvoice.CuryOrigDocAmt], 0)

Sum in the Aggregate function column

In the Grouping tab, group on Customer ID

Hope this helps!

Laura

 

Translate

Forum|alt.badge.img+8
  • Semi-Pro I
  • Mar 28, 2024 12:34 AM UTC

Hi @dan_00 Create a generic Inquiry as below:

  1. Add the ARInvoices Table
  2. Under Grouping adding CustomierID
  3. Add Parmeters FromDate and ToDate
  4. In the Conditions, Add Docdate between [Fromdate] (in the Value 1 box) and [ToDate] (in the Value2 box)
  5. In the results grid,
    1. Add the CustomreID
    2. Add the OrigDocumentTotal. On this row, in the Aggregate Function column select SUM.
Translate

lauraj46
Captain II
Forum|alt.badge.img+9
  • Captain II
  • Mar 28, 2024 1:20 AM UTC

Hi @dan_00 ,

The method that @ChandraM describes will give you totals for a date range.  If you need to have columns for multiple periods such as different years then you can use a formula like the one that I shared.

Hope this helps!

Laura

Translate

Forum|alt.badge.img+8
  • Semi-Pro I
  • Mar 28, 2024 1:45 AM UTC

Hi @dan_00 Please find the details with Screenshots to guide you.

Create a generic Inquiry as below:

  1. Add the ARInvoices Table
  1.  Add Parameters FromDate and ToDate
  1. In the Conditions, Add Docdate between [Fromdate] (in the Value 1 box) and [ToDate] (in the Value2 box)

 

  1. Under Grouping adding CustomierID

 

  1. In the results grid,
  1. Add the CustomreID
  2. Add the OrigDocumentTotal. On this row, in the Aggregate Function column select SUM.
Translate

Forum|alt.badge.img+8
  • Semi-Pro I
  • Mar 28, 2024 1:47 AM UTC

@dan_00 Here is the results of the Generic Inquiry.
 

 

Translate

Forum|alt.badge.img+8
  • Semi-Pro I
  • Mar 28, 2024 1:49 AM UTC

@dan_00 Please find the attached Generic Inquiry that you can import on your Generic Inquiry Screen.

Please verify and let me know your feedback.

 

Thanks

Chandra

Translate

Forum|alt.badge.img
  • Author
  • Freshman I
  • Mar 28, 2024 2:46 AM UTC

Hi @dan_00 ,

You could create a formula field on the Results tab similar to this:

=iif(year([ARInvoice.InvoiceDate])=2021, [ARInvoice.CuryOrigDocAmt], 0)

Sum in the Aggregate function column

In the Grouping tab, group on Customer ID

Hope this helps!

Laura

 

THANKYOU!!!!!!!!!!

Translate