Sum By Date in Access 2002 Form Footer

S

schlake21

I'm working with a form that I've developed for tracking time. In the form
footer, I want to automatically display a running total of the time logged
for today.
Column Name from the source table holding the data I want to sum: TimeSpent

I currently have a Text Box in the Form Footer with Control Source:
=nz(Sum([TimeSpent])*24)

My time is calculating perfectly as I have it, but it is summing all data
from TimeSpent; I want to limit what it is pulling to all records with
Today's date.

My problem is that I'm learning as I go and don't have a background in SQL,
so I don't know how to write the equation. Another option would be to query
TimeSpent by today [Date()], but again, with the Source Table being the
master table, I don't know how to call the Query and field to display in my
Text Box.

Thanks for your help!

Gabe
 
K

KARL DEWEY

You must have a field to record the date the TimeSpent entry is made.
Try this --
=Sum(IIF(DateValue([RecordDate]) = Date(), [TimeSpent])*24)
 
S

schlake21

Karl, I'm in love with you.

Thanks!
Gabe

KARL DEWEY said:
You must have a field to record the date the TimeSpent entry is made.
Try this --
=Sum(IIF(DateValue([RecordDate]) = Date(), [TimeSpent])*24)

--
KARL DEWEY
Build a little - Test a little


schlake21 said:
I'm working with a form that I've developed for tracking time. In the form
footer, I want to automatically display a running total of the time logged
for today.
Column Name from the source table holding the data I want to sum: TimeSpent

I currently have a Text Box in the Form Footer with Control Source:
=nz(Sum([TimeSpent])*24)

My time is calculating perfectly as I have it, but it is summing all data
from TimeSpent; I want to limit what it is pulling to all records with
Today's date.

My problem is that I'm learning as I go and don't have a background in SQL,
so I don't know how to write the equation. Another option would be to query
TimeSpent by today [Date()], but again, with the Source Table being the
master table, I don't know how to call the Query and field to display in my
Text Box.

Thanks for your help!

Gabe
 

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

Similar Threads


Top