Solved

Remaining Months

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

813 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

19 Experts available now in Live!

Get 1:1 Help Now