Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DCount to pull through specific data from the query

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Dear All,

Thanks for a great forum!!

I have a problem I have on one of my reports.

I have a report that pulls data from serveral queries.

The report: PS1

I am pulling data from the query: EnNoticesCases.

I am using the following code in a textbox to pull through my desired data.
Code:
=DCount("TNOT","EnNoticesCases","TNOT"="PCON_N")

So I want it to count the number of records in the TNOT field that have PCON_N as a criteria.

At the moment the output is 0, which is not true, because there are 2 records with the TNOT field which contain PCON_N

Any help will be greatly appreciated [bigsmile]

Kind regards

Triacona
 
DOH!!

Solved!!
hehe!

The solution is as follows:
Code:
=DCount("TNOT","EnNoticesCases","[TNOT]='PCON_N'")

Darn syntax!
I was missing declaring the field in brackets [], and declaring the comparison as a string "" and putting the string in the field as ''


Thanks all!
Kind regards

Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top