View Full Version : Find Expiry Date


Hayley Baxter
12-11-2001, 04:20 AM
I need to create a query to find out when a contract expires 3 months in advance. For example if the expiry date is in March I need to know of this in December.

How can I create a query to count from the contract start date to end date so I will know it is due to expire in 3months?

I know there is a count function and also an edate worksheet function which sounds like it may work. Unfortunately I dont know how to use this.

Can anyone help?

Many thanks
Hayley

Rich
12-11-2001, 05:08 AM
Look up the DateAdd DateDiff functions in help, there are several examples.
HTH

Hayley Baxter
12-14-2001, 03:19 AM
Ive had a look at these functions but Im still a bit lost can anyone give me an example of what I should be puting into my query.

Thanks
Hayley

Rich
12-14-2001, 06:06 AM
<=DateAdd("m",3,Date())As the criteria for your next due field

[This message has been edited by Rich (edited 12-14-2001).]

Hayley Baxter
12-14-2001, 06:13 AM
Just before I give that a go can you tell me if DateAdd is recognised as a function in the query or do I need to add this as a field to my table?

Thanks for your help

Rich
12-14-2001, 06:18 AM
In your query, since next due is presumeably a calculated field it shouldn't be stored in a table
HTH

Hayley Baxter
12-14-2001, 06:25 AM
I have a field called Expiry Warning. I take it I make this field a calculated field in my query then I enter that criteria?

Please correct me if Im wrong Im just getting to know access!

Hayley Baxter
12-14-2001, 07:24 AM
Ok I have got a calculated control called expiry warning and the criteria like this

=DateAdd("m",3,Date())

This is giving me a date thet is 3mths ahead of todays date I get 14th March 2002. What do I need to do to get 3mths before my contract end date? I have tried to type in contract end date but I get an error msg.

Also I want it to notify me it is due to expire for the duration of the month not only for the 1 date.

Does anyone have any advice for me on this. Im really lost!!

Rich
12-14-2001, 08:44 AM
The criteria is <=DateAdd("m",3,Date())in the contract end date field.
Is the contract always the same fixed length?
If it's not then you can store it in the table.
Just add the field from the table and set the criteria to the above this will show all contracts with less than 3months to run. Of course it will also show those that have already expired unless you archive them.
HTH

Hayley Baxter
12-14-2001, 08:55 AM
The contract end date will be different everytime. I added the criteria to the contract end date field in my query. I do have one contract at the moment that meets this criteria - yet it is not being displayed in my query!

Any ideas?