Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Expression in a query

Using query designer I have this code:

TouringCount: Abs(Count([ID]) And [PublicActivityCode]="GT")

Which doesn't work.  I'm trying to count the records (ID) where PublicActivityCode] = "GT" or "ST".

It needs to be an expression because I have more of these types of fields to add.
Avatar of Bill Ross
Bill Ross
Flag of United States of America image

Hi,

Change the query to group by
Put [ID] as a count field in the query
Make criteria  [PublicActivityCode]="GT"

Regards,

Bill
Hi,

You can also create a field using the expression

dcount("ID",yourtable,"PublicActivityCode='GT'")

but this will be slower.

Regards,

Bill
FYI - ABS is not required.  Count can never be <0.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial