|
-
Jul 9th, 2007, 11:50 PM
#1
Thread Starter
Fanatic Member
Looping records
im using ms access as backend database;
this are my records;
Debit ---> Credit ---> Balance
============================
0.00 ---> 100.00 ---> 0.00
50.00 ---> 0.00 ---> 0.00
0.00 ---> 25.00 ---> 0.00
75.00 ---> 0.00 ---> 0.00
now using Do while | Loop statement it goes like this;
Debit Credit Balance
===========================
0.00 100.00 100.00
50.00 0.00 50.00
0.00 25.00 75.00
75.00 0.00 0.00
Balance = Credit - Debit
is there an easiest way to do this w/o looping the records? because if it is thousand of records? it takes me time before it display the results
kindly help me pls?
-
Jul 9th, 2007, 11:58 PM
#2
-
Jul 10th, 2007, 01:54 AM
#3
Re: Looping records
I used MS Access, while the program graws the execution time greatly increases. so i just moved to MSSQL and now feel very comfortable.
Consider moving to MSSQL
-
Jul 10th, 2007, 04:46 AM
#4
Re: Looping records
You have created the same thread twice.
-
Jul 10th, 2007, 05:17 AM
#5
Hyperactive Member
Re: Looping records
If you only want to display the Balance (credit - debit) then just change your SQL query a bit:
Code:
SELECT credit - debit FROM tablename
-
Jul 10th, 2007, 05:27 AM
#6
Re: Looping records
 Originally Posted by BillGeek
If you only want to display the Balance (credit - debit) then just change your SQL query a bit:
Code:
SELECT credit - debit FROM tablename
Its not a per record calculation... its a running balance, previous balance is adjusted with current debit and credit to get current balance.
-
Jul 10th, 2007, 05:30 AM
#7
Hyperactive Member
Re: Looping records
According to the original question asked, it seemed like the aim was to display the Credit, Debit and (Credit - Debit)... Am I missing something?
-
Jul 10th, 2007, 05:33 AM
#8
Re: Looping records
 Originally Posted by BillGeek
According to the original question asked, it seemed like the aim was to display the Credit, Debit and (Credit - Debit)... Am I missing something?
Your misinterpreting the data, probably 'cause you looked at only the first 2 lines.
Credit 100 to 0 --- Balance 100
Debit 50 from 100 --- Balance 50
Credit 25 to 50 --- Balance 75
Debit 75 from 75 --- Balance 0
-
Jul 10th, 2007, 05:35 AM
#9
-
Jul 10th, 2007, 09:09 AM
#10
Re: Looping records
Duplicate threads merged.
Please do not create multiple threads for the same question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|