Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Use SQL To Report Summary Data
Message
From
13/11/2006 15:51:23
 
 
To
13/11/2006 15:32:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01169288
Message ID:
01169294
Views:
8
CREATE TABLE myTable (myfield n(10,0))  && myfield will hold values from 1 to 300
APPEND BLANK
REPLACE myfield WITH 1
for i = 2 TO 300
   APPEND BLANK 
   REPLACE myfield WITH i
endfor

*--Group myfield by the myfield field myrange 1 = 0->9, 2 = 10->24...
SELECT IIF(myfield >= 0 and myfield <=9, 1, ;
  IIF(myfield >=10 and myfield <=24, 2, ;
  IIF(myfield >=25 and myfield <=49, 3, ;
  IIF(myfield >=50 and myfield <=99, 4, ;
  IIF(myfield >=100 and myfield <=249, 5, 6))))) AS MyRange, Myfield ;
 FROM MyTable ;
 INTO CURSOR cTemp1
>I need to create a summary cursor of a loan file. The customer would like the items grouped based on the number of employees the borrowing company has. The groupings are (0 - 9, 10 - 24, 25 - 49, 50 - 99, 100 - 249 and 250 +). Is there a way I can do this with a SQL statement?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform