Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting and Identifying Values
Message
From
04/06/2001 12:21:32
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00514598
Message ID:
00514651
Views:
9
Sergey,
I am trying the second option. That's in line of what I was thinking of.
I'll let you know how it went.
thaks for your help



>Try following code ( I didn't test it)
>
>
>Select ;
>	0 As Vals, ;
>		Sum(IIF(Fld1=0, 1, 0)) As Cnt1, ;
>		Sum(IIF(Fld2=0, 1, 0)) As Cnt2, ;
>		....
>		Sum(IIF(Fld30=0, 1, 0)) As Cnt30, ;
>	From Mytable ;	
>Union ;		
>Select ;
>	1 As Vals, ;
>		Sum(IIF(Fld1=1, 1, 0)) As Cnt1, ;
>		Sum(IIF(Fld2=1, 1, 0)) As Cnt2, ;
>		....
>		Sum(IIF(Fld30=1, 1, 0)) As Cnt30, ;
>	From Mytable ;	
>...
>Union ;		
>Select ;
>	5 As Vals, ;
>		Sum(IIF(Fld1=5, 1, 0)) As Cnt1, ;
>		Sum(IIF(Fld2=5, 1, 0)) As Cnt2, ;
>		....
>		Sum(IIF(Fld30=5, 1, 0)) As Cnt30, ;
>	From Mytable ;	
>	Order By 1 ;
>	Into Cursor Mycursor
>

>or
>
>
>FOR liVals=0 To 5
>	lcCursor = "Mycursor" + Transfom(liVals)	
>	Select ;
>		liVals As Vals, ;
>			Sum(IIF(Fld1=liVals, 1, 0)) As Cnt1, ;
>			Sum(IIF(Fld2=liVals, 1, 0)) As Cnt2, ;
>			....
>			Sum(IIF(Fld30=liVals, 1, 0)) As Cnt30, ;
>		From Mytable ;	
>		Into Cursor (lcCursor)
>ENDFOR
>
>and tnan combine 6 cursors Mycursor0-Mycursor5 into one cursor Mycursor
Previous
Reply
Map
View

Click here to load this message in the networking platform