Source language: Translate to:

SUM

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

SUM

Postby Stefan » Mon Feb 09, 2009 8:54 am

Hi to All!

I have a report with a Group Header, Data Body and a Group Footer.
In the Data Body i have the fields: [db.quantity] and [db.price]
I have also a formula: [db.quantity]*[db.price] = total price of each line

In the Group Footer i will have the sum of [db.quantity] = OK, i know how to set that: SUM( [aproto.quantity] )

BUT NOW:
What ist the formula for the sum of the total price of each line ([db.quantity]*[db.price]) ?

Is that possible? Have some one an Idea?
THANKS!
Stefan
 
Posts: 35
Joined: Mon Dec 03, 2007 7:00 am

Postby Neosoft Support » Mon Feb 09, 2009 5:37 pm

You could do something like this:

SUM( [db.quantity] ) * SUM( [db.price] )

But it's not possible to have the Report Designer produce a tally of items across multiple records. Instead what you need to do is use dbpExecSQL to perform a query that includes a calculated field and store the results in a temporary table. Then use the temporary table in your report.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Stefan » Mon Feb 09, 2009 11:26 pm

Thanks, but this formula give a false result and i think it's not possible to become the totalprice with a dbpExecSQL-Command.
In this case I think it is neeeded to expand the tables and calculate the values in my software....

In the good old DOS-Software Open Access - in the report-designer there was a possibility to define variables in the report like:

"totalprice": [db.quantity]*[db.price]

and then in the group Footer:
SUM(totalprice)

Stefan
Stefan
 
Posts: 35
Joined: Mon Dec 03, 2007 7:00 am

Postby Neosoft Support » Tue Feb 10, 2009 10:55 am

Maybe we can add something like that in the future.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron