What is wrong with this expression? Operand w/o an operator?

D

dave.degroot

=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )
 
R

Rob Parker

I suspect that you need something like:
=DCount("[suspense_id]","YourTableName")/DCount("("[suspense_id]","YourTableName","[Justified?]
= True")

But without any details that's really a WAG ;-)

HTH

Rob
 
D

dave.degroot

I suspect that you need something like:
=DCount("[suspense_id]","YourTableName")/DCount("("[suspense_id]","YourTabl­eName","[Justified?]
= True")

But without any details that's really a WAG ;-)

HTH

Rob




=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )- Hide quoted text -

- Show quoted text -

Can I use the name of a query instead of a table name?
 
R

Rob Parker

Yes. You can consider a query as a virtual table. In the domain aggregate
function (dCount, dLoookup, etc), you can enter either a table or query name
for the domain.

But, if the query you are using is a Totals query, the value in a Count
field may not be what you want in a dCount expression. You'll probably need
to use the source table/query in the dCount expression I posted.

HTH

Rob

I suspect that you need something like:

=DCount("[suspense_id]","YourTableName")/DCount("("[suspense_id]","YourTabl­eName","[Justified?]
= True")

But without any details that's really a WAG ;-)

HTH

Rob




=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )- Hide quoted text -

- Show quoted text -

Can I use the name of a query instead of a table name?
 
D

dave.degroot

Yes. You can consider a query as a virtual table. In the domain aggregate
function (dCount, dLoookup, etc), you can enter either a table or query name
for the domain.

But, if the query you are using is a Totals query, the value in a Count
field may not be what you want in a dCount expression. You'll probably need
to use the source table/query in the dCount expression I posted.

HTH

Rob


I suspect that you need something like:
=DCount("[suspense_id]","YourTableName")/DCount("("[suspense_id]","YourTabl­­eName","[Justified?]
= True")
But without any details that's really a WAG ;-)

=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )- Hide quoted text -
- Show quoted text -

Can I use the name of a query instead of a table name?- Hide quoted text -

- Show quoted text -

This doesn't seem to work:

=DCount("("[suspense_id]","all closed suspenses","[Justified?]
= True") / DCount("[suspense_id]","all closed suspenses")
 
D

dave.degroot

Yes. You can consider a query as a virtual table. In the domain aggregate
function (dCount, dLoookup, etc), you can enter either a table or query name
for the domain.

But, if the query you are using is a Totals query, the value in a Count
field may not be what you want in a dCount expression. You'll probably need
to use the source table/query in the dCount expression I posted.

HTH

Rob


I suspect that you need something like:
=DCount("[suspense_id]","YourTableName")/DCount("("[suspense_id]","YourTabl­­eName","[Justified?]
= True")
But without any details that's really a WAG ;-)

=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )- Hide quoted text -
- Show quoted text -

Can I use the name of a query instead of a table name?- Hide quoted text -

- Show quoted text -

Still get the operand error as before.
 
A

Allen Browne

Try:
=Sum( IIf([Justified?], [CountOfsuspense_id], 0) )

Note this cannot go in the Page Footer of the report.
(Report Footer or group footer is fine.)
 
D

dave.degroot

Try:
=Sum( IIf([Justified?], [CountOfsuspense_id], 0) )

Note this cannot go in the Page Footer of the report.
(Report Footer or group footer is fine.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




=(Sum( [CountOfsuspense_id] WHERE [Justified?] = True ) /
Sum([CountOfsuspense_id] )- Hide quoted text -

- Show quoted text -

Yep, that worked. Thanks ever so much!

D.
 

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