Solved

Remaining Months

Posted on 2003-11-11
3
469 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
  • 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 33

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 33

Expert Comment

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now