on 02-10-2010 3:52 PM
Hi there, I am writing a fairly simple query from JDT1, but i can't find the cumulative balance column in either ODJT or JDT1. is it in a different table or is there a formula i should write?
thanks, my example query is below:
SELECT T1.[TransId], T1.[Account], T1.[CreatedBy], T1.[ContraAct], T1.[LineMemo], T1.[Credit], T1.[Debit], T1.[DebCred], FROM [dbo].[JDT1] T1 INNER JOIN OJDT T2 ON T1.TransId = T2.TransId WHERE T1.[Account] = '[%0]' and T1.[RefDate] between '[%1]' and '[%2]'
Hello Groovy,
You can use the word SUM to sum the different values.
E.g. this sums the values of both credit and debit side and it was used in the query generator:
SELECT sum(T0.[Debit]) + sum(T0.[Credit]) FROM JDT1 T0 INNER JOIN OJDT T1 ON T0.TransId = T1.TransId WHERE T1.[TransId] = '95' group by t1.transid
or if you want the total of the column you can use:
select SUM (debit) from jdt1 where transid = 'XXX'
and it will sum the total of debit for that transid.
Please, let me know if the information helped you. If not, can you please give us more information about what you need?
Thank you.
Marcella Rivi
SAP Business One Forums Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is no such field or table for you to hold those cumulative balances. They are calculated on the fly in run time application.
One option for you would be: export your query result to Excel and get those cumulative balances by a new column with a simple formula.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
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.