Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Use SQL To Report Summary Data
Message
 
 
To
13/11/2006 15:55:41
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:
01169301
Views:
9
Also you don't have to check for intervals
ICASE(	myfield > 249, 6 ;
		myfield > 99, 5 ;
		myfield > 49, 4 ;
		myfield > 24, 3 ;
		myfield > 9, 2 ;
		1)
>You are right, of course! I didn't even think of ICASE() for some reason.
>
>
>>Tracy,
>>
>>The ICASE() would be better.
>>
>>>
>>>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?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform