Re: Get number of records, but not the record contents?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Lee Derbyshire (a_at_t)
Date: 03/16/05


Date: Wed, 16 Mar 2005 09:51:02 -0000


Thanks, I'll try it.

"Jerold Schulman" <Jerry@jsiinc.com> wrote in message
news:pg5e319d9n6gf7cv1pqrjjaq5p80askt5a@4ax.com...
> On Tue, 15 Mar 2005 15:57:04 -0000, "Lee Derbyshire" <email a@t
> leederbyshire d.0.t c.0.m> wrote:
>
>>
>>Hi All,
>>
>>Is there a way of finding out the number of records that ~would~ have
>>been returned by a query, but without actually returning all the
>>actual records?
>>
>>Thanks,
>>
>>Lee.
>>
>
> You could use dsquery, tip 6820, 7714, & 7992 in the 'Tips & Tricks' at
> http://www.jsiinc.com
> to write a script.
>
> If you wanted the number of users in Georgia with a surname that starts
> with "S"
>
> @echo off
> setlocal ENABLEDELAYEDEXPANSION
> set qry=dsquery * domainroot -filter
> "(&(objectCategory=Person)(objectClass=User)(sn=s*))" -attr st -limit 0
> set /a cnt=0
> for /f "Tokens=*" %%a in ('%qry%^|FIND /I "GA"') do (
> set /a cnt=!cnt! +1
> )
> @echo The number of users in Georgia with a surname that starts with "S"
> are: %cnt%
> endlocal
>
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com



Relevant Pages