need help with Dsum

G

Guest

I'm putting this on a calculated control, but if enough people complain and
say to put it in the query I'll move it. However, I still need help getting
it to work. The table is "Working Hours" Columns are Member ID, Start,
Finish, WorkDate. I need the dsum to sum hours worked for each month. Here's
what I have so far and get a ?Name error

=NZ(DSum("([EndTime] - [StartTime]) *
24","WORKING_MEMBER_HOURS","[MemberID]=" & [MemberID] &
DatePart("m",[WorkDate]) & "= 1"),0)

It's really the date part I'm having problems with. What is the syntax to
get the sum for dates in each month.

Clear as mud? ;)

tia

HB
 
G

Guest

Getting closer....it is on a parent form and the reason for the ?Name error
was that work date should be WORKING_MEMBER_HOURS.Form!WorkDate now,
getting #error message...any idea why that message?

Full field is now:

=NZ(DSum("([EndTime] - [StartTime]) *
24","WORKING_MEMBER_HOURS","[MemberID]=" & [MemberID] &
Format(WORKING_MEMBER_HOURS.Form!WorkDate,"mmm") & "= Feb"),0)

again,

tia

HB
 

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