Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: DEREK DODOO
  Where is DEREK DODOO?
 READING, UK
 United Kingdom
 DEREK DODOO
 Tags
Subject: RE: range counter not working well
Thread ID: 143149 Message ID: 143154 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Saturday, August 25, 2007 12:00:10 PM         
   


Shorter version:

Create Cursor AGE_FIVE (AGE_FGRP C(8),Name C(5))

For ix = 0 To 75/5
  Insert Into AGE_FIVE (AGE_FGRP,Name) Values ;
    ( Ltrim(Str(m.ix*5))+'-'+Ltrim(Str(m.ix*5+4)),;
    PADL(m.ix*5+4,3,'0'))
Endfor

Select af.AGE_FGRP,af.Name,Nvl(age.Numb,0) As 'Numb' ;
  FROM AGE_FIVE af ;
  LEFT Join ( ;
  SELECT ;
  FLOOR((Year(Date())-Year(datebth))/5) * 5 + 4 As ageHigh, ;
  CNT(*) As 'Numb' ;
  FROM vpaymast ;
  GROUP By 1 ) age ;
  ON af.Name == Padl(age.ageHigh,3,'0') ;
  ORDER By 2 ;
  INTO Cursor AGE_FIVE


Cetin Basoz

ENTIRE THREAD

range counter not working well Posted by DEREK DODOO @ 8/25/2007 10:59:35 AM
RE: range counter not working well Posted by Cetin Basoz @ 8/25/2007 11:46:02 AM
RE: range counter not working well Posted by Cetin Basoz @ 8/25/2007 12:00:10 PM