[AccessD] Count of records in PK range

Stuart McLachlan stuart at lexacorp.com.pg
Thu Apr 2 23:07:12 CDT 2009


Sorry, I'm using too many different languages at the same time.
In TSQL use  Floor()

-- 
Stuart

On 2 Apr 2009 at 23:46, jwcolby wrote:

> Stuart,
> 
> The only problem... a small problem... Int() is not a built-in function of TSQL AFAICS.
> 
> 8)
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 
> Stuart McLachlan wrote:
> > You mean something like:
> > 
> > Select Distinct, Int(PKID/1000000) as PKMegRange, Count(*) as Records
> > from myTable
> > Group By Int(PKID/1000000)
> > Order by Int(PKID/1000000)
> > 
> > On 2 Apr 2009 at 14:51, jwcolby wrote:
> > 
> >> You could do that.  But I need it to show me steps of X PKID.  Perhaps
> >> every 1 meg PK over 50 megs of records. 
> > ,,,
> >> Charlotte Foust wrote:
> >>> Maybe this is too simple, but wouldn't you just select Count(PKID) Where
> >>> PKID less than or equal to PKID Z and Greater than or equal to PKID Y?
> >>> -----Original Message-----
> > ...
> >>> I need to get a count of records in a PK range in SQL Server.  For
> >>> example I need to know that there are X addresses between PKID Y and
> >>> PKID Z.
> >>>
> >>> Any idea how to do this in tsql?
> > 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list