PC Review


Reply
Thread Tools Rate Thread

Accumulated Balance In Query

 
 
wisemax@yahoo.com
Guest
Posts: n/a
 
      12th Feb 2006
Date Cash-In Accumulated

1/1/2006 $5.00 5
1/2/2006 $23.00 $28.00
1/3/2006 $12.00 $40.00
1/31/2006 $21.00 $61.00

How do I build the third field in a query?

Thanks in advance

HZ

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      12th Feb 2006
SELECT TransactionDate, [CashIn],
DSum("[CashIn]","Finance","TransactionDate <=" &
Format([TransactionDate],"\#mm\/dd\/yyyy\#")) AS Accumulated
FROM Finance;

Note that Date isn't a good choice for a field name, as it's a reserved
word. Cash-In isn't a great choice either, because of the - in it (it can be
confused with subtraction)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Date Cash-In Accumulated
>
> 1/1/2006 $5.00 5
> 1/2/2006 $23.00 $28.00
> 1/3/2006 $12.00 $40.00
> 1/31/2006 $21.00 $61.00
>
> How do I build the third field in a query?
>
> Thanks in advance
>
> HZ
>



 
Reply With Quote
 
wisemax@yahoo.com
Guest
Posts: n/a
 
      12th Feb 2006
Thank you Doug for your prompt help. But after I run this SQL, I see
this below

SELECT CashPaid.TransactionDate, CashPaid.CashPaidAmount,
DSum("[CashPaidAmount]","CashPaid","TransactionDate <=transactiondate")
AS Accumulated
FROM CashPaid;


Date Paid Cash Paid Amount Accumulated
2/1/1997 $500.00 2000
3/1/1997 $800.00 2000
11/5/1996 $700.00 2000


What I did is wrong?

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      12th Feb 2006
That's not what I said to use. Look at what I gave you again (reproduced
below, with names changed to reflect your new information).

See how I've got transaction date outside of the quotes in the DSum, and I'm
using the Format statement on it?

SELECT TransactionDate, CashPaidAmount,
DSum("[CashPaidAmount]","CashPaid","TransactionDate <=" &
Format([TransactionDate],"\#mm\/dd\/yyyy\#")) AS Accumulated
FROM CashPaid;



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you Doug for your prompt help. But after I run this SQL, I see
> this below
>
> SELECT CashPaid.TransactionDate, CashPaid.CashPaidAmount,
> DSum("[CashPaidAmount]","CashPaid","TransactionDate <=transactiondate")
> AS Accumulated
> FROM CashPaid;
>
>
> Date Paid Cash Paid Amount Accumulated
> 2/1/1997 $500.00 2000
> 3/1/1997 $800.00 2000
> 11/5/1996 $700.00 2000
>
>
> What I did is wrong?
>



 
Reply With Quote
 
wisemax@yahoo.com
Guest
Posts: n/a
 
      13th Feb 2006
It works. I sincerely appreciate your help.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to calculate an accumulated balance Marshall Barton Microsoft Access Queries 1 26th Jul 2008 07:51 PM
Balance Comparison Query =?Utf-8?B?TmF0YWxpZQ==?= Microsoft Access Queries 2 11th Oct 2007 03:09 AM
Balance Query =?Utf-8?B?U3RldmVu?= Microsoft Access Queries 10 20th Sep 2006 01:11 PM
Query - accumulated =?Utf-8?B?U8OpcmdpbyBBaXJlcw==?= Microsoft Access Queries 2 23rd Feb 2006 12:30 PM
balance query =?Utf-8?B?aGFycnlvdG9vbGU=?= Microsoft Access Queries 1 30th Nov 2005 10:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:07 PM.