Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
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, 6:50 am This article has been viewed 35215 times. Google search has resulted in 31 hits on this article since January 25, 2004.
|
|