Report sums based on record dates

home70

Registered User.
Local time
Today, 00:06
Joined
Jul 10, 2006
Messages
72
I have a table of transactions, some with past dates, some dated the current date, and some dated in the near future. On a report, I'm looking for a way to get four different sums using the transactions in the table, each sum based on the dates of the transactions. I need a sum of transactions in the current month dated the 15 though the 31st, the sum of transactions from next month dated 1st through 14th, the sum of transactions next month dated 15th through 31st (or 30th depending on the month) and the sum of transactions from the month after next dated the 1st through the 14th.
I think I've got one working. This one seems to work for next month dated 15th through 31st:
=Sum(IIf([DateTransaction]>=DateSerial(Year(Date()),Month(Date())+1,15-0),[AmountDebit],0))

I can't figure the others out. Can anyone help me with this? I appreciate it.
 
Last edited:
Original poster here. I found the answer on another forum, and I thought I would post the solution here to help people searching on this problem.

All month =Sum(IIf([DateTransaction]>DateSerial(Year(Date()),Month(Date())+1,0),[AmountDebit],0))

One day =Sum(IIf([DateTransaction]=DateSerial(Year(Date()),Month(Date())+1,25),[AmountDebit],0))

Current month 15th -31st =Sum(IIf([DateTransaction] Between DateSerial(Year(Date()),Month(Date()),15) And DateSerial(Year(Date()),Month(Date())+1,0),[AmountTrans],0))

Next month 1st-14th =Sum(IIf([DateTransaction] Between DateSerial(Year(Date()),Month(Date())+1,0) And DateSerial(Year(Date()),Month(Date())+1,14),[AmountTrans],0))

Next month 15th-31st =Sum(IIf([DateTransaction] Between DateSerial(Year(Date()),Month(Date())+1,15) And DateSerial(Year(Date()),Month(Date())+2,0),[AmountTrans],0))

Month after 1st-14th =Sum(IIf([DateTransaction] Between DateSerial(Year(Date()),Month(Date())+2,0) And DateSerial(Year(Date()),Month(Date())+2,14),[AmountTrans],0))
 

Users who are viewing this thread

Back
Top Bottom