Solved

Queries using the end of current year date

Posted on 2011-09-11
4
193 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
4 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
To get the end of the current year:

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

Accepted Solution

by:
lludden earned 500 total points
Comment Utility
Age at end of current year is:

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

Expert Comment

by:Qlemo
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
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 …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

772 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

12 Experts available now in Live!

Get 1:1 Help Now