dcount in a crosstab query

I

inungh

TRANSFORM Count(MyQuery.ID) as CountOfID
SELECT MyQuery.Code, DCount("*" , "tblActivityDetails" ,
[ActivityDate] >= #3/14/2010# and [ActivityDate] <= #3/20/2010# and
[ActivityID] = tblActivityDetails.ActivityID) AS Total,
Count(MyQuery.ID) AS [Total Elements]

I have above DCount in my crosstab query. It seems that crosstab does
not like DCount in the query.

The Dcount works in a select query.

any information is great appreciated,
 
D

Duane Hookom

I haven't had issues with DCount() in crosstabs. Try correct the syntax to:
DCount("*" , "tblActivityDetails" , "[ActivityDate] Between #3/14/2010# and
#3/20/2010# and ActivityID=" & [ActivityID] )
This assumes ActivityID is a numeric field in MyQuery.
 
I

inungh

I haven't had issues with DCount() in crosstabs. Try correct the syntax to:
DCount("*" , "tblActivityDetails" , "[ActivityDate] Between #3/14/2010# and
#3/20/2010# and ActivityID=" & [ActivityID]  )
 This assumes ActivityID is a numeric field in MyQuery.

--
Duane Hookom
MS Access MVP




TRANSFORM Count(MyQuery.ID) as CountOfID
SELECT MyQuery.Code, DCount("*" , "tblActivityDetails" ,
[ActivityDate] >= #3/14/2010# and [ActivityDate] <= #3/20/2010# and
[ActivityID] = tblActivityDetails.ActivityID) AS Total,
Count(MyQuery.ID) AS [Total Elements]
I have above DCount in my crosstab query. It seems that crosstab does
not like DCount in the query.
The Dcount works in a select query.
any information is great appreciated,- Hide quoted text -

- Show quoted text -

Thanks for helping,
Yes, DCount is working. The problem is the activityID is in the same
table of the query.
Are there any way to refer the ID field in the same query?

Thanks again,
 
D

Duane Hookom

What do you mean by the same query?

--
Duane Hookom
MS Access MVP


inungh said:
I haven't had issues with DCount() in crosstabs. Try correct the syntax
to:
DCount("*" , "tblActivityDetails" , "[ActivityDate] Between #3/14/2010#
and
#3/20/2010# and ActivityID=" & [ActivityID] )
This assumes ActivityID is a numeric field in MyQuery.

--
Duane Hookom
MS Access MVP




TRANSFORM Count(MyQuery.ID) as CountOfID
SELECT MyQuery.Code, DCount("*" , "tblActivityDetails" ,
[ActivityDate] >= #3/14/2010# and [ActivityDate] <= #3/20/2010# and
[ActivityID] = tblActivityDetails.ActivityID) AS Total,
Count(MyQuery.ID) AS [Total Elements]
I have above DCount in my crosstab query. It seems that crosstab does
not like DCount in the query.
The Dcount works in a select query.
any information is great appreciated,- Hide quoted text -

- Show quoted text -

Thanks for helping,
Yes, DCount is working. The problem is the activityID is in the same
table of the query.
Are there any way to refer the ID field in the same query?

Thanks again,
 

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