Solved

Remaining Months

Posted on 2003-11-11
3
487 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 250 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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