Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group By - Continued Help Needed
Message
 
To
17/03/2004 11:37:45
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00887107
Message ID:
00887121
Views:
14
Cannot see what is wrong with the group by, except AP-COMPUTERS should give 15500, not 11500. Maybe you are talking about the order? Then
Select... order by 2 desc
>No. The final code that I have with sum_ap_totals already has summed the totals from a cursor that is created and processed before this one. So the end result cursor already has sum totals in a column called sum_ap_total, the original code use that created that column was sum(ap_total)
>
>
>>Is this what you need?
>>
>>select id_desc,SUM(totals) ;
>>from sql_ap_pre ;
>>where ap_status = .pcStatus ;
>>group by id_desc ;
>>into cursor sql_ap readwrite
>>
>>
>>
>>>Hello,
>>>
>>>I have tried every suggestion that has been given to me regarding the whole "Group By" subject. However, I still do not seem to be accomplishing what VFP 6/7 was able to accomplish in VFP 8. I am beginning to wonder if it does work with this new SQL statement type. Everytime I attempt this "Group By" in any sense of my code, it still gives me the information seperately inside the grid. I attempted to re-write the code over and over again, but every version comes out the same or worse. I attempted the MAX() code into the fields, but destroyed my output data into figures that did not match up or correct figures that were placed multiple times.
>>>
>>>
>>>select id_desc,sum_ap_total ;
>>>from sql_ap_pre ;
>>>where ap_status = .pcStatus ;
>>>group by id_desc, sum_ap_total ;
>>>into cursor sql_ap readwrite
>>>
>>>
>>>The id_desc and totals are shown as:
>>>
>>>AP-MISC                        500.00
>>>AP-OFFICESUPPLIES              500.00
>>>AP-OFFICESUPPLIES              500.00
>>>AP-OFFICESUPPLIES             2000.00
>>>AP-COMPUTERS                  5000.00
>>>AP-COMPUTERS                  3000.00
>>>AP-COMPUTERS                  7000.00
>>>AP-COMPUTERS                  1500.00
>>>AP-OFFICESUPPLIES               50.00
>>>AP-MISC                       1000.00
>>>
>>>
>>>where as I am trying to accomplish:
>>>
>>>AP-COMPUTERS                  11500.00
>>>AP-OFFICESUPPLIES              3050.00
>>>AP-MISC                        1500.00
>>>
>>>
>>>I even narrowed this code down thinking that it was because I have more fields originally, but even when I now have only two fields, it does not come out right. Does anyone please have a solution for this in VFP 8 aside from using the 7 Engine to calculate correctly??
>>>
>>>Thank you so much!!
Previous
Reply
Map
View

Click here to load this message in the networking platform