Home All Groups Group Topic Archive Search About

running balance in datagrid

Author
15 Mar 2006 1:16 AM
jaypee1978
Anyone know how can I create a running balance in a datagrid? In
MS-Access this could be very simple. This is what my sql in MS-Access
query:

SELECT AccountDetails.AccountDetailID AS AccountDetailIDAlias,
AccountDetails.AccountID, AccountDetails.Date, AccountDetails.Invoice,
AccountDetails.Debit, AccountDetails.Credit,
Format(DSum("[Debit]-[Credit]","AccountDetails","[AccountDetailID]<=" &
[AccountDetailIDAlias]),".00") AS Balance
FROM AccountDetails;

I used OleDbDataAdapter and a dataset to bind a datagrid.

Thanks in advance.

Author
15 Mar 2006 6:11 AM
Cor Ligthert [MVP]
jaypee,

This is a VB language code newsgroup. Therefore we are not so interested in
your SQL language code, however in the VB language code that you have used
(and tell what kind of datagrid it is Windowform or Webform)

Probably it is than easy to help you.

Cor

<jaypee1***@gmail.com> schreef in bericht
Show quoteHide quote
news:1142385400.249511.91880@v46g2000cwv.googlegroups.com...
> Anyone know how can I create a running balance in a datagrid? In
> MS-Access this could be very simple. This is what my sql in MS-Access
> query:
>
> SELECT AccountDetails.AccountDetailID AS AccountDetailIDAlias,
> AccountDetails.AccountID, AccountDetails.Date, AccountDetails.Invoice,
> AccountDetails.Debit, AccountDetails.Credit,
> Format(DSum("[Debit]-[Credit]","AccountDetails","[AccountDetailID]<=" &
> [AccountDetailIDAlias]),".00") AS Balance
> FROM AccountDetails;
>
> I used OleDbDataAdapter and a dataset to bind a datagrid.
>
> Thanks in advance.
>
Author
15 Mar 2006 9:14 AM
jaypee1978
I'm using a windowform.

> > SELECT AccountDetails.AccountDetailID AS AccountDetailIDAlias,
> > AccountDetails.AccountID, AccountDetails.Date, AccountDetails.Invoice,
> > AccountDetails.Debit, AccountDetails.Credit,
> > Format(DSum("[Debit]-[Credit]","AccountDetails","[AccountDetailID]<=" &
> > [AccountDetailIDAlias]),".00") AS Balance
> > FROM AccountDetails;

this sql statement is under the selectcommand of oledbdataadapter.


Cor Ligthert [MVP] wrote:
Show quoteHide quote
> jaypee,
>
> This is a VB language code newsgroup. Therefore we are not so interested in
> your SQL language code, however in the VB language code that you have used
> (and tell what kind of datagrid it is Windowform or Webform)
>
> Probably it is than easy to help you.
>
> Cor
>
> <jaypee1***@gmail.com> schreef in bericht
> news:1142385400.249511.91880@v46g2000cwv.googlegroups.com...
> > Anyone know how can I create a running balance in a datagrid? In
> > MS-Access this could be very simple. This is what my sql in MS-Access
> > query:
> >
> > SELECT AccountDetails.AccountDetailID AS AccountDetailIDAlias,
> > AccountDetails.AccountID, AccountDetails.Date, AccountDetails.Invoice,
> > AccountDetails.Debit, AccountDetails.Credit,
> > Format(DSum("[Debit]-[Credit]","AccountDetails","[AccountDetailID]<=" &
> > [AccountDetailIDAlias]),".00") AS Balance
> > FROM AccountDetails;
> >
> > I used OleDbDataAdapter and a dataset to bind a datagrid.
> >
> > Thanks in advance.
> >