running balance in datagrid

J

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

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
 
J

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.

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top