Query based on future paydays

home70

Registered User.
Local time
Today, 09:01
Joined
Jul 10, 2006
Messages
72
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 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 from the transactions that are coming out of this payday.
Thanks for your help.
 
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.
 
DateSerial(Year(Date()),Month(Date())+1,15);

RV
 
Well, I've had mixed results. 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?
Did I mis-state my question by originally asking about queries since I'm trying to put this into a report? (I noticed that I couldn't make queries work with the synatx above that works on a report) Originally I thought I'd use queries for this but I'm now thinking that I need the info on reports and I don't know how to make a report (or form for that matter) use different queries on different fields.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom