Arthur Fuller
fuller.artful at gmail.com
Fri Feb 26 08:33:37 CST 2010
Since this is an Access query as opposed to a SQL Server query, it seems you're doing way too much work. Why not just do this: x = Nz(DCount("*", "yourQueryName", "yourCriteriaIfAny")) Then if x = 0, do something or if not, do something else. hth, Arthur On Fri, Feb 26, 2010 at 9:11 AM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > I have a query that may or may not return any records. I need to count the > number of records returned if there are some or 0 if there are no records. I > have tried the following with no success.. > > RA Inj Count: IIf(IsNull(Count(Nz([PID]))),0,Count(Nz([PID]))) > RA Inj Count: Nz(Count(Nz([PID])),0) >