Solved

Queries using the end of current year date

Posted on 2011-09-11
4
196 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 69

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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 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 create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

726 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