Count Months in form

G

GGill

I have in my form text box 'MyDate' and text box 'Month after date'.
Quaterly i need count moths in my text box 'Month after date'.
For example:

next 1 quarter

If my current date between 3/31/2006-6/29/06 then count month
between 'MyDate' and 3/31/06

next 2 quarter

If my current date between 6/30/2006-9/29/06 then count month
between 'MyDate' and 6/30/06

next 3 quarter

If my current date between 9/30/2006-12/30/06 then count month
between 'MyDate' and 9/30/06

next 4 quarter

If my current date between 12/31/2006-3/30/07 then count month
between 'MyDate' and 12/31/06


Please help me to figure out this.
Thank you
 
W

Wayne-I-M

Hi Gill

Not really sure what you mean as you are asking a count of months between
Current date- Date() -and 2 other dates [MyDate] and [Month after date]

As you know what you want and you can see the data you are working with it's
best if you use the cource source shown below to whatever fits your
application best

To count the number of months between 2 dates. Create a new text box with
this as its control source

=DateDiff("m", [DateField1], [DateField2])
or from current date
=DateDiff("m", Date(), [DateField2])

Hope this helps
 
G

GGill

Thank you.
That's exactly what i was looking.
Thank you

Wayne-I-M said:
Hi Gill

Not really sure what you mean as you are asking a count of months between
Current date- Date() -and 2 other dates [MyDate] and [Month after date]

As you know what you want and you can see the data you are working with it's
best if you use the cource source shown below to whatever fits your
application best

To count the number of months between 2 dates. Create a new text box with
this as its control source

=DateDiff("m", [DateField1], [DateField2])
or from current date
=DateDiff("m", Date(), [DateField2])

Hope this helps


--
Wayne
Manchester, England.
Enjoy whatever it is you do


GGill said:
I have in my form text box 'MyDate' and text box 'Month after date'.
Quaterly i need count moths in my text box 'Month after date'.
For example:

next 1 quarter

If my current date between 3/31/2006-6/29/06 then count month
between 'MyDate' and 3/31/06

next 2 quarter

If my current date between 6/30/2006-9/29/06 then count month
between 'MyDate' and 6/30/06

next 3 quarter

If my current date between 9/30/2006-12/30/06 then count month
between 'MyDate' and 9/30/06

next 4 quarter

If my current date between 12/31/2006-3/30/07 then count month
between 'MyDate' and 12/31/06


Please help me to figure out this.
Thank you
 
M

Maxi

Wayne-I-M said:
Hi Gill

Not really sure what you mean as you are asking a count of months between
Current date- Date() -and 2 other dates [MyDate] and [Month after date]

As you know what you want and you can see the data you are working with it's
best if you use the cource source shown below to whatever fits your
application best

To count the number of months between 2 dates. Create a new text box with
this as its control source

=DateDiff("m", [DateField1], [DateField2])
or from current date
=DateDiff("m", Date(), [DateField2])

Hope this helps


--
Wayne
Manchester, England.
Enjoy whatever it is you do


GGill said:
I have in my form text box 'MyDate' and text box 'Month after date'.
Quaterly i need count moths in my text box 'Month after date'.
For example:

next 1 quarter

If my current date between 3/31/2006-6/29/06 then count month
between 'MyDate' and 3/31/06

next 2 quarter

If my current date between 6/30/2006-9/29/06 then count month
between 'MyDate' and 6/30/06

next 3 quarter

If my current date between 9/30/2006-12/30/06 then count month
between 'MyDate' and 9/30/06

next 4 quarter

If my current date between 12/31/2006-3/30/07 then count month
between 'MyDate' and 12/31/06


Please help me to figure out this.
Thank you

If you are using formulas to count the months, they generally ignore
the day of the month.
From 1/1/06 to 2/28/06 may give the same result as 1/31/06 to 2/1/06.
The following post may help.
http://www.tek-tips.com/viewthread.cfm?qid=1255733

Michael Red's response was excellent.
 
Top