dcount in a crosstab query

  • Thread starter Thread starter inungh
  • Start date Start date
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,
 
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 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,
 
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,
 
Back
Top