If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report sums based on record dates
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 on this? I appreciate it. |
#2
|
|||
|
|||
Report sums based on record dates
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)) |
Thread Tools | |
Display Modes | |
|
|