Solved

Queries using the end of current year date

Posted on 2011-09-11
4
197 Views
Last Modified: 2012-05-12
In November of each year I need to be able to update the age of each member as of 12/31/XXXX, whatever the current year. How do I write the update queries EofY Age and EofY LOM without having to change the date in the queries each year? Thank you.
0
Comment
Question by:lheroux
[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
4 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 36520640
To get the end of the current year:

Dateserial(year(now()),12,31)
0
 
LVL 18

Accepted Solution

by:
lludden earned 500 total points
ID: 36520643
Age at end of current year is:

UPDATE mytable SET Age =  int(DateDiff("m",Birthdate,DateSerial(Year(Now()),12,31))/12)
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 37218503
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

734 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