calculations to come up on a form

G

Guest

Hello Folks:

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

Previous months comp total $100 (1)


Fund Date Comp Credit
722A 3/1/05 $1.00 (2) $101.00 (3)
722A 3/2/05 $10.00 $111.00
722A 3/3/05 ($5.00) $106.00

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

I need to have this need to come up on a form and in a report.
FYI, I'm not very experienced at visual basic.
 
M

Michel Walsh

Hi,


Is that some class home work ? That is about five time the same
question is asked, with few variations in the data.



Vanderghast, Access MVP
 
G

Guest

Hello Michel:

No. it's not homework. I've been asked to take a task that has been done on
spreadsheets and convert it to a database. The math challenge on this has me
stumped. The solution that I got a few days ago was to use VB code. I barely
have enough VB experience to maek a combo box. I'm just looking for a simpler
solution.

Robert
 
M

Michel Walsh

Hi,

Then the answers made in microsoft.public.access.queries should fill
your need, isn't it, no?

Here again, then


SELECT a.Fund, a.[Date], LAST(a.Comp), SUM(b.comp)
FROM myTable As a INNER JOIN myTable As b
ON a.Fund = b.Fund and a.[Date] >= b.[Date]
GROUP BY a.Fund, a.[Date]



And you supply a record, with a date far in the past, for the starting
amount, for each different Fund.



Vanderghast, Access MVP
 

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