Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the last 5 years automatically throug where clausile

Status
Not open for further replies.

Ericordina

Technical User
Joined
Nov 28, 2006
Messages
10
Location
NL
Hello,

I'm trying to create an report in wich i can
use automatically the information of the last 5 years.

the field in the table is filled till 2099 and the max year must be the year eq system year.

I hope someone can give me some advise to solve this

greetings
eric
 
From what you've described, you can use the Dialogue Manager to calculate the starting year of your 5 year span.
The code would look something like this:

Code:
-SET &THISYEAR =  &DATEYY;
-SET &STARTYR = &DATEYY - 4;
-TYPE &THISYEAR &STARTYR

The -TYPE was to show what values were set. Then, in your request, you might code:

Code:
WHERE YEAR FROM &STARTYR TO &THISYEAR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top