Query for records before or after paydays

G

Guest

I have a table of checking transactions. Some are past, some from
today, and some are dated with future dates (such as recurring
payments).
Is there a way to set up a query for my balance (credits minus debits)
that will exclude transactions that occur after upcoming paydays (1st
and 15th) dynamically? For instance, if I have a transaction scheduled
for the 2nd of next month (after payday on the 1st) I'd like to be able
to separate it dynamically/automatically from the transactions that are
coming out of this payday.
I have tried WHERE <=TransactionDate(Year(Date()),Month(Date()),0)
but it only returns transactions up until and not including this month.
Anyone know how to do this?
Thanks for your help.
 
G

Guest

OK, I have found how to get it to return all transactions up to and including
the current month's:
WHERE datetransaction<=DateSerial(Year(Date()),Month(Date()),31);
where the 31 represents the date of the current month.

Also I see how to query for transactions after a certain date of the current
month, for instance this will return all transactions dated on or after the
15th of the current month:
WHERE datetransaction>=DateSerial(Year(Date()),Month(Date()),15);

But now what I'm having trouble with is how to reference next month.
 
G

Guest

I'm sorry, I'm afraid I asked my question wrong.
I asked about how to query but I'm now thinking that I need the info on
reports since I don't know how to make a report (or form for that matter) use
different queries on different fields.
I've figured out some of this but the rest I've had trouble with. I
appreciate your help on this so I hope you know I'm not trying to be thick
headed here.
I have set up some sample transactions for next month and set up a dummy
report to pull the transactions depending on their dates.
I've had luck with one to pull all transactions for next month
=Sum(IIf([DateTransaction]>DateSerial(Year(Date()),Month(Date())+1,0),[AmountDebit],0))

and one to pull all transactions next month dated 15th through 30th
=Sum(IIf([DateTransaction]>=DateSerial(Year(Date()),Month(Date())+1,15-0),[AmountDebit],0))

and one that pulls a specific day next month
=Sum(IIf([DateTransaction]=DateSerial(Year(Date()),Month(Date())+1,25),[AmountDebit],0))

but that's as far as I can figure out. I'm missing one to pull transactions
this month 15th through 31st, next month dated 1st through 14th, and one to
pull the month after next dated 1st through 14th.

Can you tell me what I'm doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top