Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a conditional SUM
Message
 
To
24/12/1998 12:24:01
Marcelo Codino
Mystic & Faith - Sistemas -
Buenos Aires, Argentina
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00170147
Message ID:
00170318
Views:
27
>Thanks for your help Nick, it works.Sorry because I don´t tell you that the report must have dDateFrom and dDateTo.I have this SQL in the Report Datasession.Init().It works fine in my ListBox, now I want to obtain the same results by printer.What´s your suggest about this ?
>
>
>
> SELECT a.fecha, a.concepto,a.importe,a.val_cuota,;
>  IIF(!EMPTY(a.cuotas),RTRIM(a.cuotas)+ "/" + LTRIM(a.can_cuotas),ALLT(a.cuotas)),;
>  SUM(IIF(a.plan,a.val_cuota,a.importe)) AS n_impo;
>  FROM Master a ;
>  WHERE BETWEEN(a.fecha,dDateFrom,dDateTo) ;
>  OR a.plan = .T. ;
>  AND a.fecha <= dDateTo ;
>  AND a.cuotas <> a.can_cuotas ;
>  GROUP BY a.nro_oper ;
>  ORDER BY a.fecha ;
>  INTO CURSOR c_names
>
If I understand you right, you need to display all data collected into this cursor in the report. Then you need to SELECT the resulting cursor and run your report on it. In this case report fields should include only the field names from the cursor(without alias).
Or do you want those records from the cursor displayed in report footer?
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform