Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sum formula Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Sum formula
     Posted: 23 Feb 2012 at 1:48am
Hi all,

I am currently working on an invoice file for a client.
On this file, there are a couple of fields. In the database, the information in stored in 2 tables, one containing the amount paid, the other one containing wether is has been paid to us or directly towards the client.

On the invoice, there are a couple of fields. For example the account number, with the amounts belonging to this (paid to us, paid to client)

For the amount paid to us, I have created a formula, which is saying that, if the amount is paid to us, I want to show the amount, and if it's paid directly to the client, I want it to show 0. Did the same for when it is paid to the client. So far so good.

But now I want to create a formula to show the sum of these records. So the sum of amounts paid to us and the sum of amounts paid to client. I created the following query in Access, this is giving exactly wat I want. But I can't seem to figure out how to put it in Crystal. The query is:

SELECT Sum(COLLDESK_CF_DATOS_COLLDESK.COBRO) AS SumOfCOBRO
FROM COLLDESK_CF_DATOS_COLLDESK INNER JOIN COLLDESK_TIPO_FORMA_PAGO ON COLLDESK_CF_DATOS_COLLDESK.FORMA_PAGO = COLLDESK_TIPO_FORMA_PAGO.TIPO
WHERE (((COLLDESK_CF_DATOS_COLLDESK.ID_FACTURAS) Is Null) AND ((COLLDESK_TIPO_FORMA_PAGO.TIPO_COBRO)<>"o"));


Can anybody help me with this?

Thanks in advance!

kind regards,

Gerben
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 23 Feb 2012 at 3:17am
Never mind, fixed it!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum