?
Solved

Remaining Months

Posted on 2003-11-11
3
Medium Priority
?
495 Views
Last Modified: 2008-05-15
Hello all,

I have an Access database with a table that has all of the Cellular phones on my company's account.  One of the fields in each record is the date on which the service contract ends for that phone.  What can I do to get Access to calculate how many months is left on the contract?

Thanks.
0
Comment
Question by:jonathansnyder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
walterecook earned 1000 total points
ID: 9728138
Set up a query that looks at your table and have this field:
newfield: [yourDatefield]-date()
(where yourdateField is the name of your date field)
This returns the number in days.
To see it in months:
newfield: Format([yourDatefield]-Date(),"m")

Good luck
Walt
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 9728148
Select CellID, DateDiff("m",DateField, Date()) As MonthsRemainning From MyTable Order By CellID

Change table name and fields names an make a query out of above SQL.

Mike
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 9728162
change to:  DateDiff("m",Date,DateField)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question