Here's a challenge

G

Guest

Hello Folks:

Here's an example below fo what I'm trying to do:

(1)Previous months compensation total $3,799,595,90


Fund Date Compensation Credit
722A March 01, 2005 ($0.02) $3,799,595.88 (3)
722A March 02, 2005 $10,000.01 $3,809,595.89
722A March 03, 2005 ($308,578.30) $3,501,017.59

I want to take the Previous months compensation total (1) and add to it the
current days compensation (2). The following day the query needs to take the
updated credit amount from the previous day (3) and add to it the current
days compensation for the new value.

I would like to somehow have a query hold this information. These values
need to come up on a form and in a report. I'm open to suggestions.
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

SELECT Fund, [Date], Compensation,
(SELECT Sum(Compensation) FROM table
WHERE Fund = T.Fund AND [Date] <= T.[Date]) As Credit
FROM table As T
WHERE < criteria >

In queries for reports: for some reason reports don't "like" subqueries
in the SELECT clause. Therefore, for reports use a DSum() function:

DSum("Compensation", "table",
"Fund=" & T.Fund & " AND [Date] <=" T.[Date]) As Credit

Change table/column names to suit your set up.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQksHoYechKqOuFEgEQIDawCfQPSvf4VCK6msnKaId+QfmVbECC8AoJQP
NIpefl96s8eXwGuobyzcoaXa
=o3ic
-----END PGP SIGNATURE-----
 

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