on 01-17-2011 3:55 AM
Hi Avelino Fidel.
Account balance current time, you can use CurrTotal feild in table OACT.
regards
H2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avelino Fidel,
i don't understand you in first reply . if you want to select Business Partner cumulative running total.
you can use this query:
SELECT dbo.OCRD.CardCode, dbo.OCRD.CardName , SUM(dbo.JDT1.Debit - dbo.JDT1.Credit) AS BPBalance
FROM dbo.JDT1 INNER JOIN
dbo.OCRD ON dbo.JDT1.ShortName = dbo.OCRD.CardCode
GROUP BY dbo.OCRD.CardCode, dbo.OCRD.CardName
I hope it can help you.
H2.
hi hoe,
thanks for the response. but you may miss understood my question... i need the running cumulative balance of a business partner using Crystal reports. i have successfully fetch my data that i need in the report. what i need is how to get the running cumulative balance in the report please see this image http://i264.photobucket.com/albums/ii184/abing430/OpenBalance.png
pls. help..
thanks
Hi Avelino Fidel,
running cumulative balance of a business partner.
The first, you create one funtion run cumulative.
CREATE FUNCTION [dbo].[FUN_CUMULATIVE_BP]( @CARDCODE NVARCHAR(20) ,@TRANSID INT )
RETURNS FLOAT
BEGIN
DECLARE @RESULT AS FLOAT
SET @RESULT = 0
SELECT TOP 1 @RESULT = SUM(T0.Debit - T0.Credit)
FROM dbo.JDT1 AS T0 INNER JOIN dbo.OCRD AS T1 ON T0.ShortName = T1.CardCode
WHERE (T1.CardCode = @CARDCODE ) and T0.transID <= @TRANSID
RETURN @RESULT
END
second, you can use this query for crystal.
SELECT OJDT.TransId,dbo.OJDT.RefDate , dbo.JDT1.BaseRef ,dbo.OCRD.CardCode, dbo.OCRD.CardName,
(dbo.JDT1.Debit - dbo.JDT1.Credit) AS BPBalance , [dbo].FUN_CUMULATIVE_BP(dbo.OCRD.CardCode,OJDT.TransId) AS BPCumulative
FROM dbo.JDT1 INNER JOIN
dbo.OCRD ON dbo.JDT1.ShortName = dbo.OCRD.CardCode INNER JOIN
dbo.OJDT ON dbo.JDT1.TransId = dbo.OJDT.TransId
WHERE (dbo.OCRD.CardCode = 'C100001')
order by OJDT.TransId
you should create parameter BPcode in crystal .
Regards,
H2
@ Hoe,
thanks for the response and effort for helping me.
@ Julie
thanks for your response,
@Balakumar
i have manage to figure out how to achieve my requirement before checking the forum w/ the ff. formulas.
//Head
whileprintingrecords;
if OnFirstRecord then Shared numbervar OB := {Command.Open Balance}
//Line
whileprintingrecords;
shared numbervar OB;
OB := OB + {BP_AccountBalance;1.Credit} - {BP_AccountBalance;1.Debit}
//Footer
whileprintingrecords;
Shared numbervar OB
its more or less almost the same with your solution/formula. many thanks for you.
best regards,
Fidel
Have you tried creating a running total field in your report & adding that to your report?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.