Count entries within a 6 month period

Steve_T

Registered User.
Local time
Today, 20:46
Joined
Feb 6, 2008
Messages
96
Hello all,
I need your help please, i have a Form that also has a Subform in it. I need to create a Text box on the form that will display a number which will reflect the total enties made against a particular ID within a rolling six month period using the system date as a perameter. The number shown will only reflect previous entries made that fall within the six months from the current system date, and will need to update once new entry is made. Incase i have confussed the hell out of you, let me give you an example:

Example One

Entry made today = 24/02/08
Previous entry Date = 20/10/07

Textbox on Form = 2

Example Two

Entry made today = 24/02/08
Previous entry Date = 20/08/07

Textbox on Form = 1
 
Last edited:
Entry made today = Date() 'This will put in today's date
Previous entry date = DateAdd("m", -6, Date()) 'This will subtract 6 months from today's date
 
GolferGuy,
Thanks for help,
I dont think i explained my problem well so i am sorry. What i am looking for is a way of to check previous entries in a Subform and if they fall in a 6 Month period from new entry made today. Then they would be counted and the figure to be displayed in a Textbox.
So for example if the subform showed 6 entries but only 4 of them were within six months of todays date then the figure 4 would be returned in the Textbox. I was looking along the lines of a If Statement.

Either way thanks for helping
 
So, what do you need? The way to do an IIf statement, how to find a date 6 months before now, both put together, or what?
 
Hi,
I assume it would be an IIf statement, but i am not sure how to write it. i need it to look at previous entries in a Subform and to only count the ones that were made within the last six months from todays date. Then to return the counted value to a Textbox on the form on which the Subform is on.
Very sorry if not explaining myself well
 

Users who are viewing this thread

Back
Top Bottom