` Using view to retrieve aggregate results (Scott Ferrett) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

SQL Related Articles: Using view to retrieve aggregate results
2004-03-17 -- Scott Ferrett
 
Newsgroups: softvelocity.public.clarion6 > DUMMYGETSUM{PROP:SQL}='SELECT ' &| > ' SUM(Debit_Sindlr),' &| > ' SUM(Credit_Sindlr),' &| > ' COUNT(AUTONUMBER1),' &| > ' SUM(Debit_Actual),' &| > ' SUM(Credit_Actual),' &| > ' 0,' &| > ' 0 ' &| > ' FROM BANKDESC WHERE AUTONUMBER = ' & BNK:AUTONUMBER This is probably easier to code in SQL, but you can code it in pure Clarion thus: v VIEW(DummyGetSum) PROJECT (DUMSUM:VALUE1) PROJECT (DUMSUM:VALUE2) PROJECT (DUMSUM:VALUE3) PROJECT (DUMSUM:VALUE4) PROJECT (DUMSUM:VALUE5) END v{'DUMSUM:VALUE1', PROP:Name} = 'SUM(Debit_Sindlr)' v{'DUMSUM:VALUE2', PROP:Name} = 'SUM(Credit_Sindlr)' v{'DUMSUM:VALUE3', PROP:Name} = 'COUNT(AUTONUMBER1)' v{'DUMSUM:VALUE4', PROP:Name} = 'SUM(Debit_Actual)' v{'DUMSUM:VALUE5', PROP:Name} = 'SUM(Credit_Actual)' v{PROP:Filter} = 'SQL(AUTONUMBER =' & BNK:AUTONUMBER & ')' SET(v) LOOP Next(v) If ErrorCode() Break End End


Today is November 21, 2024, 2:36 pm
This article has been viewed 35216 times.
Google search has resulted in 31 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: