count months

  • Thread starter Thread starter Josh Henry
  • Start date Start date
J

Josh Henry

I have a table with a date field [LeaseBegins]. I want to
write a query that counts the number of months between
that date and a date the query prompts me for (or the
current day, which is what i would enter) and then
multiply that number time the amount rent costs, which is
in the field [Rent]. If it were only 9/1/04 and the lease
began on 8/1/04, I want that to be counted as 2 months
because rent is due on or before the beginning of the
month. Would anyone know how to write an expression that
could evaluate this? thanks very much.
Josh
 
SOmething along these lines? what would u do different?
thanks


Amount Due: Count month(between 1/1/04 and [enter ending
date]) * [Rent]
 
I mean...

Amount Due: Count month(between [Rent Pay's Start] and
[enter ending date]) * [Rent]

-----Original Message-----
SOmething along these lines? what would u do different?
thanks


Amount Due: Count month(between 1/1/04 and [enter ending
date]) * [Rent]
-----Original Message-----
I have a table with a date field [LeaseBegins]. I want to
write a query that counts the number of months between
that date and a date the query prompts me for (or the
current day, which is what i would enter) and then
multiply that number time the amount rent costs, which is
in the field [Rent]. If it were only 9/1/04 and the lease
began on 8/1/04, I want that to be counted as 2 months
because rent is due on or before the beginning of the
month. Would anyone know how to write an expression that
could evaluate this? thanks very much.
Josh
.
.
 
I have a table with a date field [LeaseBegins]. I want to
write a query that counts the number of months between
that date and a date the query prompts me for (or the
current day, which is what i would enter) and then
multiply that number time the amount rent costs, which is
in the field [Rent]. If it were only 9/1/04 and the lease
began on 8/1/04, I want that to be counted as 2 months
because rent is due on or before the beginning of the
month. Would anyone know how to write an expression that
could evaluate this? thanks very much.
Josh

Try using the DateDiff() function:

DateDiff("m", [LeaseBegins], Date())

will return an integer count of months.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
How about something like:

Amount Due: DateDiff("m", [StartDate], [EndDate]) * [Rent]

Personally, I would put your StartDate and EndDate as text
boxes on a form, the same one that contains the rent
amount.

HTH
Dale


-----Original Message-----
I mean...

Amount Due: Count month(between [Rent Pay's Start] and
[enter ending date]) * [Rent]

-----Original Message-----
SOmething along these lines? what would u do different?
thanks


Amount Due: Count month(between 1/1/04 and [enter ending
date]) * [Rent]
-----Original Message-----
I have a table with a date field [LeaseBegins]. I want to
write a query that counts the number of months between
that date and a date the query prompts me for (or the
current day, which is what i would enter) and then
multiply that number time the amount rent costs, which is
in the field [Rent]. If it were only 9/1/04 and the lease
began on 8/1/04, I want that to be counted as 2 months
because rent is due on or before the beginning of the
month. Would anyone know how to write an expression that
could evaluate this? thanks very much.
Josh
.
.
.
 
Back
Top