Solved

Remaining Months

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

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

697 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