Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Service in Groups
Message
From
18/09/2008 13:06:34
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Service in Groups
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01348676
Message ID:
01348676
Views:
48
Dear Experts

Some company wants to maintain Employees' Service duration in 5 years groups as
CREATE cursor Years (cname c(15),arrival D(8), Depart d(8))
INSERT INTO Years VALUES ('A',{^1945-07-01},{^1965-07-01}) 	&& 20 year
INSERT INTO Years VALUES ('B',{^1975-07-01},{^1977-07-01})	&& 2 year
INSERT INTO Years VALUES ('C',{^1975-07-01},{^1977-07-01})	&& 2 year
INSERT INTO Years VALUES ('D',{^1970-07-01},{^1991-07-01})	&& 21 year
INSERT INTO Years VALUES ('E',{^1981-07-01},{^1986-07-01})	&& 5 year
INSERT INTO Years VALUES ('F',{^1981-07-01},{^1986-07-01})	&& 5 year
INSERT INTO Years VALUES ('G',{^1987-07-01},{^1997-07-01})	&& 10 year
INSERT INTO Years VALUES ('H',{^1998-07-01},{^2009-07-01})	&& 11 year
INSERT INTO Years VALUES ('H',{^1940-07-01},{^1975-07-01})	&& 35 year
I want to get following results
var1=4  && duration is between 1 to 5 year
var2=1	&& duration is between 6 to 10 year
var3=1	&& duration is between 11 to 15 years
var4=1	&& duration is between 16 to 20 years
var5=1	&& duration is between 21 to 25 years
var6=0	&& duration is between 26 to 30 years
var7=1	&& duration is between 31 to 35 years
and so on. Every group consists on 5 years

Please help
Next
Reply
Map
View

Click here to load this message in the networking platform