PC Review


Reply
Thread Tools Rate Thread

Attn: Doug Steele - Most Accumulated Value

 
 
wisemax@yahoo.com
Guest
Posts: n/a
 
      14th Feb 2006
This query

SELECT [Cash Paid].TransactionDate, [Cash Paid].CashPaidAmount,
DSum("[CashPaidAmount]","Cash Paid","TransactionDate <=" &
Format([TransactionDate],"\#mm\/dd\/yyyy\#")) AS Accumulated
FROM [Cash Paid]
WHERE ((([Cash Paid].TransactionDate) Is Not Null And ([Cash
Paid].TransactionDate)<=[Forms]![BS Dialog]![EndingDate]));

generates this result

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

I want to pull out the most recent Accumulated as an entry to Balance
Sheet. In this case, it is $2,000

I could not get this done in this query. So I tried to build second
query that looks like this
SELECT IIf([TransactionDate]=Max([TransactionDate]),[Accumulated]) AS
CurrentCashPaidAmount
FROM [BS Cash Paid];

It simply don't work.

Can you help?

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      15th Feb 2006
If all you want is the final accumulation, you don't need a query for that:
a simple DSum should suffice.

DSum("CashPaidAmount", "[Cash Paid]", "TransactionDate Is Not Null And
TransactionDate <= " & Format([Forms]![BS Dialog]![EndingDate],
"\#mm\/dd\/yyyy\#"))


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


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This query
>
> SELECT [Cash Paid].TransactionDate, [Cash Paid].CashPaidAmount,
> DSum("[CashPaidAmount]","Cash Paid","TransactionDate <=" &
> Format([TransactionDate],"\#mm\/dd\/yyyy\#")) AS Accumulated
> FROM [Cash Paid]
> WHERE ((([Cash Paid].TransactionDate) Is Not Null And ([Cash
> Paid].TransactionDate)<=[Forms]![BS Dialog]![EndingDate]));
>
> generates this result
>
> Date Paid Cash Paid Amount Accumulated
> 2/1/1997 $500.00 1200
> 3/1/1997 $800.00 2000
> 11/5/1996 $700.00 700
>
> I want to pull out the most recent Accumulated as an entry to Balance
> Sheet. In this case, it is $2,000
>
> I could not get this done in this query. So I tried to build second
> query that looks like this
> SELECT IIf([TransactionDate]=Max([TransactionDate]),[Accumulated]) AS
> CurrentCashPaidAmount
> FROM [BS Cash Paid];
>
> It simply don't work.
>
> Can you 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
Question for Doug Steele about drag n drop =?Utf-8?B?RWxhaW5lIEs=?= Microsoft Access Form Coding 1 7th Mar 2007 06:45 PM
Doug Steele's DB Object Documenter mehlREMOVETHIS@cyvest.com Microsoft Access 1 9th Nov 2006 01:13 AM
Doug Steele Object Documentor error =?Utf-8?B?SmVmZiBXZWlubWFu?= Microsoft Access 8 16th Oct 2006 08:13 PM
Further help with Email code please - Doug Steele, David Cox? =?Utf-8?B?Sm9obkI=?= Microsoft Access Form Coding 2 23rd Sep 2006 02:51 PM
repy by Doug Steele MVP printing in line John Rathier Microsoft Access Reports 1 25th Jan 2004 08:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 PM.