running totals selective year

  • Thread starter David (Gingernob)
  • Start date
D

David (Gingernob)

hi
i have a table with cost records and a dateyear field
on my form i can use the =Sum([cost]) gives me running total but i would
like to add a text box that can use a public variable 'curyear' to select
currrent year totals. i have a query that does it but how do i get the text
box to show the calculated value of the query?
query:
SELECT Sum(mobileusage.cost) AS cost
FROM years INNER JOIN mobileusage ON years.yearidx=mobileusage.billdateyear
WHERE (((mobileusage.billdateyear)=(SELECT years.yearidx FROM years WHERE
((years.yearid)=[curyear]) ) ));

does that make sense?
David
 
M

Michel Walsh

Hi,


= DSUM("cost", "mobileusage", "billdateyear=" & curyear )




could do the job, isn't it?


Hoping it may help,
Vanderghast, Access MVP
 
Top