DCount problems

W

warnett

I need some help debugging this DCount field which has been created within a
query:

Turkey count: DCount("Turkey 1 ID","Order","[Turkey 1 ID] <>
'0'")+DCount("Turkey 2 ID","Order","[Turkey 2 ID] <> '0'")+DCount("Turkey 3
ID","Order","[Turkey 3 ID] <> '0'")+DCount("Turkey 4 ID","Order","[Turkey 4
ID] <> '0'")+DCount("Turkey 5 ID","Order","[Turkey 5 ID] <> '0'")

Where turkey count is the new field made within the query.

Thanks

Jason
 
W

Wayne Morgan

There are a couple of syntax errors.

1) >DCount("Turkey 1 ID"<, This should be DCount("[Turkey 1 ID]" because
there are spaces in the field name.

2) >"[Turkey 1 ID] <> '0'"<, This would indicate that the [Turkey 1 ID]
field is a text field. If it is a number field, remove the single quotes
from around the 0.

Do this for all of the DCount uses in the equation.
 
W

warnett

k this has solved all my syntax errors. thanks.

still got problems though. this field always equals 3.

this is true for the total of turkeys of customer 1 and 2. but i was wanted
it for each customer. in this case the turkey count field for customer 1
should be 1 and the turkey count field for customer 2 should be 2.

any ideas? am i using the wrong function or sumthing?

Jason
 
W

Wayne Morgan

Right off-hand, I don't know. I would need to know more about your table and
field structure.
 
B

Big Terry

You cheating little scumbag! This sounds very similar to the A-level
coursework I am teaching my students. cheers.

Big Terry (founder of Terrys Turkeys Ltd)
 

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

macro and SQL statements 1
Assigning a variable 3
Auto populate value from one task to another in MS PROJECT 0
Dcount in query 4
Rate Look-up 1
edgewood video 0
tuff query 3
dcount return 0 3

Top