DCount problems

G

Guest

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.
 
G

Guest

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.
 
G

Guest

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
Access Dcount (multiple criteria) 3
Rate Look-up 1
Assigning a variable 3
Dcount in query 4
DCount alwaysreturning 1 0
dcount return 0 3
Dcount - Criteria 3

Top