Am Freitag, den 20.05.2005, 09:52 +0100 schrieb Hugo Ramos:
> Yellow,
> What DBMS are you using??? MySQL???
> If so just have a sql method do this:
> ==========
> SELECT COUNT( '*' )  AS total
> FROM yourtable
> ==========

Are you sure about the ' '? looks strange.

> Then call the variable total where you need it!
> Regards
> hr
> On 5/20/05, prabuddha ray <[EMAIL PROTECTED]> wrote:
> > I've this report wherein i've to print the column total iin last row.
> > column values are from database.
> > so far I'm a total loss. do i need to have cookies to store this total?

simplest solution if you need the data anyway:
a python script where you do the zsql method


return context.yourPageTemplate(results=results,count=len(results))

and use

tal:content="options/count" in the template where you need count.
If its a sum you need, just work over your resultset or use a separate

Easiest to work over result set (especially if the select is costy)


for item in results:
   if item.value: # this handles the case of nulls

and use the total as argument:

return context.yourPageTemplate(results=results,

Tino Wildenhain <[EMAIL PROTECTED]>

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to