DCount problem

  • Thread starter Thread starter Alan Nicoll
  • Start date Start date
A

Alan Nicoll

I need an incrementing count of the number of shifts where
an employee has overtime. This is the query I came up
with:

WOTCount: DCount("[Name]","Decoded_Data","[Name] = '" &
[Name] & "' AND [WeekOT]>0")

The result I want is like this:

Name WeekOT WOTCount
A 0 0
A 0 0
A 4 1
A 6 2
A 10 3
B 0 0
B 4 1

And so on. What I get from my query is all zeros in the
WOTCount field.

Alan Nicoll
 
Without seeing a sample of what is in table or
query "Decoded_Data", it is hard to say why you are
getting zeros.

The function you quote should return

Name WeekOT WOTCount
A 0 3
A 0 3
A 4 3
A 6 3
A 10 3
B 0 1
B 4 1

To get what you appear to want will depend on your source
data.
 
Back
Top