|
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
|