How do I get a "Year to date field" in a report

B

BikeGuy

I have a linked (with tblDonors) table (tblCheckData) with :ID1,
txtCheckNumber, txtCheckAmount, txtCheckDate, TxtDateReceived fields. I
can't figure out how to get a "year" total for each person who donates in a
report. I use a "parameter query" to get a partial year total but must also
report a year (or year to date) total also. Help!
 
Q

QuimaxW

I would use this as criteria for the txtCheckDate field:
#1/1/2008#
Unless you have future checks, this should work. Otherwise you could
try something like >#1/1/2008# and < #[Today's Date]#

You may even be able to put some sort of system variable into this to
'auto-fill' today's date.
 
D

Dale Fye

Since we don't know what the rest of your report query looks like, I'll just
take a stab, and you can try to implement with your setup. This assumes that
your CheckDate field is actually a date.

SELECT tblDonors.DonorID,
tblDonors.DonorName,
SUM(IIF([CheckDate] >= Dateserial(Year(Date()), 1, 1),
[CheckAmount], 0) as YearToDate
FROM tblDonors
INNER JOIN tblCheckData
ON tblDonors.DonorID = tblCheckData.DonorID
GROUP BY DonorID

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 

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